Recall Rintamäki et al. 2017 in which the authors investigate whether renewable energy generation impacts the volatility of electricity prices in Germany and Denmark (two zones in DK). They use the standard deviation of hourly prices to measure daily price volatility (and SD of daily prices for weekly volatility). They then estimate a SARMA model in each case accouning for short-term price volatility as well as weekly seasonality in the data.
Abstract: “Although variable renewable energy (VRE) technologies with zero marginal costs decrease electricity prices, the literature is inconclusive about how the resulting shift in the supply curves impacts price volatility. Because the flexibility to respond to high peak and low off-peak prices is crucial for demand-response applications and may compensate for the losses of conventional generators caused by lower average prices, there is a need to understand how the penetration of VRE affects volatility. In this paper, we build distributed lag models with Danish and German data to estimate the impact of VRE generation on electricity price volatility. We find that in Denmark wind power decreases the daily volatility of prices by flattening the hourly price profile, but in Germany it increases the volatility because it has a stronger impact on off-peak prices. Our analysis suggests that access to flexible generation capacity and wind power generation patterns contribute to these differing impacts. Meanwhile, solar power decreases price volatility in Germany. By contrast, the weekly volatility of prices increases in both areas due to the intermittency of VRE. Thus, policy measures for facilitating the integration of VRE should be tailored to such region-specific patterns.”
In each “Replicate” tab I first replicate the model from Rintamäki et al directly (excluding the control for natural gas prices as this data is proprietary/unavailable) and then make a first attempt at measuring the volatility of hourly prices directly using gets. In the “Extending to Europe” tab I provide plots of the time series of electricity price data available from EMBER (more detail on data in that section). I have chosen to include the code blocks for your reference.
In the specification looking at daily price volatility the dependent variable of interest is the standard deviation of hourly prices per day. We have the advantage of being able to model the volatility of hourly prices directly with gets.
The below specifications replicate the results reported in Rintamaki et al for daily price volatility. Unfortunately, gas spot prices are not provided in their replication data as they are proprietary (available via Bloomberg portal) - those specs have been commented out below.
Pulled from replication data available at: https://doi-org.ezproxy-prd.bodleian.ox.ac.uk/10.1016/j.eneco.2016.12.019
# Required including "here("code/rintamaki_replication/data/" to data read commands in the listed files
source(here("code/rintamaki_replication/models/read_daily_data.R"))
daily_forms <- list(
# SPECS FOR DK1
list(vol_dk1, wind_dk1, 2, 1, 2, 1, 7),
list(vol_dk1, wind_pen_dk1, 2, 1, 2, 1, 7),
list(vol_dk1, cbind(wind_dk1, exim_op1_dk1, exim_op2_dk1, exim_p_dk1), 2, 1, 2, 1, 7),
list(vol_dk1, cbind(wind_dk1, exim_op1_dk1, exim_p_dk1), 2, 1, 2, 1, 7),
list(vol_dk1, cbind(wind_pen_dk1, exim_op1_dk1, exim_p_dk1), 2, 1, 2, 1, 7),
#list(fwd1(vol_dk1), list(fwd1(wind_dk1), diff(gas_dk1))),
#SPECS FOR DK2
list(vol_dk2, wind_dk2, 2, 1, 2, 1, 7),
list(vol_dk2, wind_pen_dk2, 2, 1, 2, 1, 7),
list(vol_dk2, cbind(wind_dk2, exim_op1_dk2, exim_op2_dk2, exim_p_dk2), 2, 1, 2, 1, 7),
list(vol_dk2, cbind(wind_dk2, exim_op1_dk2, exim_p_dk2), 2, 1, 2, 1, 7),
list(vol_dk2, cbind(wind_pen_dk2, exim_op1_dk2, exim_p_dk2), 2, 1, 2, 1, 7),
#list(fwd1(vol_dk2), list(fwd1(wind_dk2), diff(gas_dk2))),
# SPECS FOR DE
list(vol_de, wind_de, 2, 1, 2, 1, 7),
list(fwd1(vol_de), diff(solar_de), 2, 1, 2, 1, 7),
list(fwd1(vol_de), cbind(fwd1(wind_de), diff(solar_de)), 2, 1, 2, 1, 7),
list(vol_de, res_de, 2, 1, 2, 1, 7),
list(vol_de, wind_pen_de, 2, 1, 2, 1, 7),
list(fwd1(vol_de), diff(solar_pen_de), 2, 1, 2, 1, 7),
list(vol_de, res_pen_de, 2, 1, 2, 1, 7),
list(fwd1(vol_de), cbind(fwd1(wind_de), diff(solar_de), fwd1(exim_op1_de), fwd1(exim_op2_de), fwd1(exim_p_de)), 2, 1, 2, 1, 7))
#list(fwd1(vol_de), list(fwd1(wind_de), diff(solar_de), diff(gas_de))))
daily_res <- lapply(daily_forms, function(x) do.call(fitModel, x))
## Warning in arima(y, order = c(p, 0, q), seasonal = list(order = c(P, 0, :
## possible convergence problem: optim gave code = 1
## Warning in arima(y, order = c(p, 0, q), seasonal = list(order = c(P, 0, :
## possible convergence problem: optim gave code = 1
## Warning in arima(y, order = c(p, 0, q), seasonal = list(order = c(P, 0, :
## possible convergence problem: optim gave code = 1
daily_res %>%
modelsummary
| (1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) | (11) | (12) | (13) | (14) | (15) | (16) | (17) | (18) | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ar1 | 1.224 | 1.221 | 1.255 | 1.245 | 1.244 | 1.233 | 1.228 | 1.269 | 1.231 | 1.229 | 1.151 | 1.166 | 1.161 | 1.155 | 1.152 | 1.166 | 1.153 | 1.151 |
| (0.039) | (0.039) | (0.038) | (0.039) | (0.039) | (0.053) | (0.054) | (0.051) | (0.054) | (0.053) | (0.036) | (0.036) | (0.031) | (0.048) | (0.024) | (0.036) | (0.036) | (0.038) | |
| ar2 | −0.253 | −0.250 | −0.279 | −0.273 | −0.272 | −0.268 | −0.264 | −0.297 | −0.268 | −0.266 | −0.162 | −0.175 | −0.171 | −0.166 | −0.163 | −0.176 | −0.164 | −0.163 |
| (0.033) | (0.032) | (0.033) | (0.033) | (0.033) | (0.041) | (0.042) | (0.041) | (0.042) | (0.042) | (0.034) | (0.034) | (0.032) | (0.040) | (0.025) | (0.034) | (0.035) | (0.035) | |
| ma1 | −0.864 | −0.863 | −0.870 | −0.867 | −0.867 | −0.838 | −0.836 | −0.852 | −0.833 | −0.833 | −0.916 | −0.917 | −0.919 | −0.915 | −0.917 | −0.915 | −0.914 | −0.928 |
| (0.029) | (0.029) | (0.026) | (0.028) | (0.028) | (0.043) | (0.044) | (0.040) | (0.044) | (0.043) | (0.018) | (0.019) | (0.015) | (0.031) | (0.015) | (0.018) | (0.019) | (0.021) | |
| sar1 | 1.071 | 1.071 | 1.081 | 1.075 | 1.075 | 1.105 | 1.106 | 1.107 | 1.105 | 1.106 | 1.177 | 1.172 | 1.175 | 1.174 | 1.177 | 1.172 | 1.174 | 1.169 |
| (0.025) | (0.025) | (0.025) | (0.026) | (0.026) | (0.025) | (0.025) | (0.025) | (0.025) | (0.025) | (0.032) | (0.032) | (0.030) | (0.034) | (0.032) | (0.032) | (0.032) | (0.032) | |
| sar2 | −0.073 | −0.072 | −0.082 | −0.077 | −0.077 | −0.106 | −0.107 | −0.107 | −0.105 | −0.106 | −0.177 | −0.172 | −0.175 | −0.174 | −0.177 | −0.172 | −0.174 | −0.169 |
| (0.025) | (0.025) | (0.025) | (0.025) | (0.025) | (0.025) | (0.025) | (0.025) | (0.025) | (0.025) | (0.032) | (0.032) | (0.030) | (0.034) | (0.032) | (0.032) | (0.032) | (0.032) | |
| sma1 | −0.980 | −0.980 | −0.983 | −0.979 | −0.979 | −0.989 | −0.990 | −0.990 | −0.988 | −0.989 | −0.990 | −0.991 | −0.987 | −0.989 | −0.989 | −0.991 | −0.990 | −0.989 |
| (0.008) | (0.008) | (0.007) | (0.008) | (0.008) | (0.006) | (0.006) | (0.006) | (0.006) | (0.006) | (0.005) | (0.000) | (0.010) | (0.019) | (0.024) | (0.009) | (0.001) | (0.001) | |
| intercept | 2.392 | 1.708 | 2.253 | 2.357 | 1.661 | 2.207 | 1.714 | 2.101 | 2.155 | 1.729 | 1.916 | 2.270 | 2.001 | 2.085 | 2.322 | 2.243 | 2.277 | 1.931 |
| (0.344) | (0.318) | (0.402) | (0.343) | (0.309) | (0.440) | (0.444) | (0.489) | (0.418) | (0.421) | (0.551) | (0.605) | (0.568) | (0.601) | (0.531) | (0.570) | (0.572) | (0.467) | |
| ext | −0.089 | −0.087 | −0.070 | −0.064 | 0.033 | −0.038 | 0.017 | 0.035 | −0.047 | 0.020 | ||||||||
| (0.016) | (0.016) | (0.015) | (0.015) | (0.015) | (0.019) | (0.023) | (0.015) | (0.019) | (0.022) | |||||||||
| wind_dk1 | −0.073 | −0.091 | ||||||||||||||||
| (0.019) | (0.019) | |||||||||||||||||
| exim_op1_dk1 | 0.064 | 0.100 | 0.102 | |||||||||||||||
| (0.033) | (0.033) | (0.033) | ||||||||||||||||
| exim_op2_dk1 | −0.224 | |||||||||||||||||
| (0.031) | ||||||||||||||||||
| exim_p_dk1 | 0.078 | −0.081 | −0.085 | |||||||||||||||
| (0.037) | (0.031) | (0.031) | ||||||||||||||||
| wind_pen_dk1 | −0.088 | |||||||||||||||||
| (0.020) | ||||||||||||||||||
| wind_dk2 | −0.052 | −0.060 | ||||||||||||||||
| (0.016) | (0.017) | |||||||||||||||||
| exim_op1_dk2 | −0.015 | −0.007 | −0.012 | |||||||||||||||
| (0.042) | (0.043) | (0.043) | ||||||||||||||||
| exim_op2_dk2 | −0.304 | |||||||||||||||||
| (0.040) | ||||||||||||||||||
| exim_p_dk2 | 0.145 | −0.047 | −0.052 | |||||||||||||||
| (0.048) | (0.042) | (0.042) | ||||||||||||||||
| wind_pen_dk2 | −0.054 | |||||||||||||||||
| (0.017) | ||||||||||||||||||
| ext1 | 0.030 | 0.037 | ||||||||||||||||
| (0.015) | (0.015) | |||||||||||||||||
| ext2 | −0.035 | −0.020 | ||||||||||||||||
| (0.019) | (0.019) | |||||||||||||||||
| ext3 | 0.085 | |||||||||||||||||
| (0.012) | ||||||||||||||||||
| ext4 | 0.022 | |||||||||||||||||
| (0.013) | ||||||||||||||||||
| ext5 | −0.078 | |||||||||||||||||
| (0.014) | ||||||||||||||||||
| Num.Obs. | 1826 | 1826 | 1826 | 1826 | 1826 | 1826 | 1826 | 1826 | 1826 | 1826 | 1096 | 1095 | 1095 | 1096 | 1096 | 1095 | 1096 | 1095 |
| AIC | 2880.8 | 2883.5 | 2822.5 | 2873.6 | 2875.7 | 3161.9 | 3165.3 | 3108.3 | 3164.2 | 3166.8 | 489.7 | 490.6 | 488.6 | 494.2 | 489.1 | 488.4 | 493.9 | 436.1 |
| BIC | 2930.4 | 2933.1 | 2888.6 | 2934.2 | 2936.3 | 3211.5 | 3214.9 | 3174.4 | 3224.8 | 3227.4 | 534.7 | 535.6 | 538.6 | 539.2 | 534.1 | 533.4 | 538.9 | 501.1 |
| RMSE | 0.53 | 0.53 | 0.52 | 0.53 | 0.53 | 0.57 | 0.57 | 0.56 | 0.57 | 0.57 | 0.30 | 0.30 | 0.30 | 0.30 | 0.30 | 0.30 | 0.30 | 0.29 |
This is where we have our current comparative advantage in that we can model hourly price volatility directly.
# Loads hourly price data for de, dk1, dk2
for(cty in c('dk1', 'dk2', 'de')){
temp <- read_xlsx(here('code/rintamaki_replication/data/raw_data.xlsx'), sheet = cty) %>%
clean_names
assign(paste0("data_", cty), temp)
}
data_de %>%
ggplot(aes(x = date, y = de_price)) +
geom_line(linewidth = 0.1) +
labs(title = "Germany: Hourly Electricity Prices", y = "Hourly Electricity Price", x = "Date")
# Check to make sure data is ordered
data_de %>% arrange(date, hour) %>% identical(data_de)
## [1] TRUE
# The below model incorporates ARCH(24) to be selected over, available regressors for wind forecasts, solar forecasts, and imports to and from France. In line with Rintamaki et al, we incorporate moving average terms for half-day, daily, and weekly prices volatility (levels?). Seasonal moving average terms are not yet incorporated here as they are in Rintamaki et al. Rather we might want to consider the seasonal moving average to have a periodicity of 24 hours (moving average over the same time of day)
de_mod <- arx(data_de$de_price,
# Include 24 ARCH terms to be selected over
# Question: In theory, the ARCH(24) would proxy the seasonal (daily) AR term?
arch = 1:24,
# Additional regressors to select over (only wind forecasts, solar forecasts, and imports between Germany and France are available at hourly frequency in the replication data)
# Worth doing additional data scoping
# Also perhaps worth including additional indicators for time of day (assuming this variation is not mopped up by the moving average terms)
vxreg = as.matrix(data_de[c('de_wind_fcast', 'de_solar_fcast', 'de_fr', 'fr_de')]),
# As in Rintamaki et al. the below line incorporates moving average terms for the half-day (12), day (24 hours) and week (168 hours)
log.ewma = c(12, 24, 168))
## Warning in arx(data_de$de_price, arch = 1:24, vxreg = as.matrix(data_de[c("de_wind_fcast", :
##
## New default 'mc = TRUE' in arx() as of version 0.28
## This warning only appears the first time arx() is invoked
## To suppress this warning, set options(mc.warning = FALSE)
# Perform gets model selection over the log-variance model above
# Turn of ARCH diagnostics as the GUM does not pass (could possible manipulate lag and p value choice here)
de_vmod <- getsv(de_mod, t.pval = 0.001, ar.LjungB = NULL)
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 1.8954e+00 1.0014e-01 358.2185 < 2.2e-16 ***
## arch1 2 0 5.8181e-01 6.2374e-03 93.2783 < 2.2e-16 ***
## arch2 3 0 -3.5317e-03 7.2259e-03 -0.4888 0.6250156
## arch3 4 0 -3.5501e-02 7.2242e-03 -4.9142 8.967e-07 ***
## arch4 5 0 -1.0043e-02 7.2186e-03 -1.3913 0.1641497
## arch5 6 0 -3.3139e-02 7.2133e-03 -4.5942 4.364e-06 ***
## arch6 7 0 -1.1185e-02 7.2128e-03 -1.5506 0.1210008
## arch7 8 0 -3.2399e-02 7.2134e-03 -4.4915 7.103e-06 ***
## arch8 9 0 -8.7058e-03 7.2241e-03 -1.2051 0.2281732
## arch9 10 0 -1.3099e-03 7.2319e-03 -0.1811 0.8562671
## arch10 11 0 -1.6037e-02 7.2305e-03 -2.2180 0.0265629 *
## arch11 12 0 -1.0092e-03 7.2273e-03 -0.1396 0.8889439
## arch12 13 0 -2.0967e-02 7.1982e-03 -2.9128 0.0035855 **
## arch13 14 0 -1.8687e-02 7.1691e-03 -2.6067 0.0091480 **
## arch14 15 0 -7.0670e-03 7.1822e-03 -0.9840 0.3251394
## arch15 16 0 -2.2407e-02 7.1833e-03 -3.1193 0.0018146 **
## arch16 17 0 -3.7778e-03 7.1829e-03 -0.5259 0.5989277
## arch17 18 0 -2.3916e-02 7.1811e-03 -3.3304 0.0008684 ***
## arch18 19 0 8.3342e-03 7.1800e-03 1.1608 0.2457487
## arch19 20 0 -4.5284e-03 7.1834e-03 -0.6304 0.5284426
## arch20 21 0 -5.3013e-03 7.1845e-03 -0.7379 0.4605924
## arch21 22 0 -9.2692e-04 7.1901e-03 -0.1289 0.8974256
## arch22 23 0 1.3481e-02 7.1919e-03 1.8744 0.0608876 .
## arch23 24 0 6.4164e-02 7.1902e-03 8.9239 < 2.2e-16 ***
## arch24 25 0 1.2186e-01 6.1825e-03 19.7100 < 2.2e-16 ***
## logEqWMA(12) 26 0 3.0409e-01 2.7297e-02 11.1402 < 2.2e-16 ***
## logEqWMA(24) 27 0 4.1168e-02 3.4000e-02 1.2108 0.2259724
## logEqWMA(168) 28 0 -3.9480e-03 2.1543e-02 -0.1833 0.8545958
## de_wind_fcast 29 0 7.4541e-06 2.2588e-06 3.3000 0.0009681 ***
## de_solar_fcast 30 0 -4.8653e-06 1.9912e-06 -2.4434 0.0145561 *
## de_fr 31 0 -1.5198e-04 1.1846e-05 -12.8305 < 2.2e-16 ***
## fr_de 32 0 -5.7088e-05 2.0817e-05 -2.7424 0.0061024 **
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 3325.5273 1 0
## Ljung-Box ARCH(25) 3.8785 25 1
## 21 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
##
## Path 1: 3 22 12 10 28 17 20 15 19 21 27 5 9 7 23 30 32 13
## Path 2: 5 12 22 10 28 3 17 20 15 19 21 27 9 7 23 30 32 13
## Path 3: 7 12 22 10 28 3 17 20 15 19 21 27 5 9 23 30 32 13
## Path 4: 9 12 22 28 3 17 20 10 15 19 21 27 5 7 23 30 32 13
## Path 5: 10 22 12 28 3 17 20 15 19 21 27 5 9 7 23 30 32 13
## Path 6: 11 28 22 3 17 20 15 19 21 27 12 9 5 7 10 23 32 30 -14
## Path 7: 12 22 28 10 3 17 20 15 19 21 27 5 9 7 23 30 32 13
## Path 8: 13 10 28 22 3 17 20 19 15 21 27 5 9 12 7 23 30 32
## Path 9: 14 22 28 12 10 17 3 20 27 21 19 9 5 7 15 23 30 32 -11
## Path 10: 15 22 12 28 10 3 17 20 19 21 27 5 9 7 23 30 32 13
## Path 11: 16 28 22 12 10 3 20 27 21 19 9 5 7 17 23 14 -30 -32 -11
## Path 12: 17 22 12 28 10 3 20 15 19 21 27 5 9 7 23 30 32 13
## Path 13: 19 20 12 22 10 28 3 17 15 21 27 5 9 7 23 30 32 13
## Path 14: 20 22 12 28 10 3 17 15 19 21 27 5 9 7 23 30 32 13
## Path 15: 21 12 28 10 3 22 17 15 27 20 19 5 9 7 23 30 32 13
## Path 16: 22 12 28 10 3 17 20 15 19 21 27 5 9 7 23 30 32 13
## Path 17: 23 12 10 28 3 17 20 22 21 19 15 5 9 7 27 30 32 13
## Path 18: 27 22 12 10 28 17 20 3 15 21 19 5 9 7 23 30 32 13
## Path 19: 28 22 12 10 3 17 20 15 19 21 27 5 9 7 23 30 32 13
## Path 20: 30 22 12 28 10 17 3 20 15 19 21 27 5 9 7 23 32 13
## Path 21: 32 28 22 12 10 3 17 20 15 27 21 19 5 9 7 23 30 13
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 8.386333 -109534.0 26139 14
## spec 2: 8.394811 -109644.8 26139 14
## spec 3: 8.385634 -109524.8 26139 14
## spec 4: 8.380971 -109453.7 26139 16
##
## Retained regressors (final model):
##
## vconst arch1 arch3 arch5 arch7 arch10 arch12 arch14 arch17 arch23 arch24 logEqWMA(12) de_wind_fcast de_solar_fcast de_fr fr_de
de_vmod %>% plot
data_dk1 %>%
ggplot(aes(x = date, y = dk1_price)) +
geom_line(linewidth = 0.1) +
labs(main = "DK1: Hourly Electricity Prices")
data_dk1 %>% arrange(date, hour) %>% identical(data_dk1)
## [1] TRUE
# Same spec as above with appropriate corrections to the regressors
dk1_mod <- arx(data_dk1$dk1_price,
arch = 1:24,
vxreg = as.matrix(data_dk1[c("dk1_load_fcast", "dk1_wind_fcast", "dk1_no2", "no2_dk1", "dk1_se3", "se3_dk1")]),
log.ewma = c(12, 24, 168))
# Perform gets model selection over the log-variance model above
dk1_vmod <- getsv(dk1_mod, t.pval = 0.001, ar.LjungB = NULL)
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 2.0172e+00 5.4321e-02 1379.0242 < 2.2e-16 ***
## arch1 2 0 6.0445e-01 4.8399e-03 124.8876 < 2.2e-16 ***
## arch2 3 0 3.0277e-02 5.6434e-03 5.3650 8.136e-08 ***
## arch3 4 0 -1.7644e-02 5.6403e-03 -3.1282 0.001760 **
## arch4 5 0 -1.2948e-02 5.6355e-03 -2.2977 0.021586 *
## arch5 6 0 -1.7261e-02 5.6325e-03 -3.0646 0.002181 **
## arch6 7 0 1.4257e-03 5.6321e-03 0.2531 0.800157
## arch7 8 0 -4.6656e-03 5.6308e-03 -0.8286 0.407345
## arch8 9 0 -1.1409e-02 5.6288e-03 -2.0268 0.042686 *
## arch9 10 0 3.1481e-03 5.6334e-03 0.5588 0.576277
## arch10 11 0 -7.0138e-03 5.6371e-03 -1.2442 0.213423
## arch11 12 0 -1.3609e-02 5.6385e-03 -2.4137 0.015797 *
## arch12 13 0 -2.3295e-02 5.6207e-03 -4.1445 3.411e-05 ***
## arch13 14 0 1.6176e-02 5.5976e-03 2.8898 0.003857 **
## arch14 15 0 -9.1378e-03 5.6031e-03 -1.6309 0.102929
## arch15 16 0 3.6041e-03 5.6050e-03 0.6430 0.520217
## arch16 17 0 -2.7019e-03 5.6056e-03 -0.4820 0.629813
## arch17 18 0 9.9656e-03 5.6073e-03 1.7773 0.075533 .
## arch18 19 0 -6.3015e-03 5.6078e-03 -1.1237 0.261142
## arch19 20 0 6.9875e-03 5.6080e-03 1.2460 0.212770
## arch20 21 0 1.1826e-02 5.6071e-03 2.1092 0.034936 *
## arch21 22 0 1.8614e-02 5.6071e-03 3.3197 0.000902 ***
## arch22 23 0 2.4458e-02 5.6079e-03 4.3613 1.296e-05 ***
## arch23 24 0 7.6882e-02 5.6049e-03 13.7168 < 2.2e-16 ***
## arch24 25 0 8.5187e-02 4.7824e-03 17.8126 < 2.2e-16 ***
## logEqWMA(12) 26 0 1.9586e-01 1.7495e-02 11.1952 < 2.2e-16 ***
## logEqWMA(24) 27 0 -4.7579e-02 1.8586e-02 -2.5600 0.010470 *
## logEqWMA(168) 28 0 2.2026e-02 1.0175e-02 2.1647 0.030418 *
## dk1_load_fcast 29 0 2.9724e-07 1.4970e-05 0.0199 0.984158
## dk1_wind_fcast 30 0 7.0917e-05 1.0943e-05 6.4808 9.219e-11 ***
## dk1_no2 31 0 -6.9258e-05 2.3247e-05 -2.9792 0.002892 **
## no2_dk1 32 0 -1.3200e-04 2.3125e-05 -5.7080 1.150e-08 ***
## dk1_se3 33 0 5.4250e-05 3.6553e-05 1.4842 0.137774
## se3_dk1 34 0 -2.9485e-06 3.3375e-05 -0.0883 0.929602
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 2396.4839 1 0.00000
## Ljung-Box ARCH(25) 5.7287 25 0.99998
## 23 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
##
## Path 1: 4 29 34 7 17 16 10 8 11 19 20 33 15 18 28 27 14 -31 -21 -9 -12 -22
## Path 2: 5 29 34 7 17 16 10 8 11 19 20 33 15 18 28 27 14 31 -9 -21 -12 -22
## Path 3: 6 29 34 17 16 10 8 11 19 20 33 15 18 7 28 27 14 -31 -12 -21 -4 -22
## Path 4: 7 29 34 17 16 10 8 11 19 20 33 15 18 28 27 5 14 31 -9 -21 -12 -22
## Path 5: 8 29 34 7 17 16 10 11 19 20 33 15 18 28 27 5 14 31 -9 -21 -12 -22
## Path 6: 9 29 34 7 10 17 16 19 20 11 33 15 18 5 28 27 8 14 -31 -21 -22
## Path 7: 10 29 34 7 17 16 8 11 19 20 33 15 18 28 27 5 14 31 -9 -21 -12 -22
## Path 8: 11 29 10 34 7 17 16 8 19 20 33 15 18 28 27 5 14 31 -9 -21 -12 -22
## Path 9: 12 29 34 7 17 16 10 8 19 20 33 15 18 5 28 27 14 11 -31 -21 -22
## Path 10: 14 29 34 7 15 17 16 10 8 11 19 20 33 18 27 28 5 31 -9 -21 -12 -22
## Path 11: 15 29 16 34 7 10 17 8 11 19 20 33 18 28 27 5 14 31 -9 -21 -12 -22
## Path 12: 16 29 34 17 7 10 8 11 19 20 33 15 18 28 27 5 14 31 -9 -21 -12 -22
## Path 13: 17 29 34 7 16 10 8 11 19 20 33 15 18 28 27 5 14 31 -9 -21 -12 -22
## Path 14: 18 29 34 7 17 19 10 8 16 11 15 20 33 28 27 5 14 31 -9 -21 -12 -22
## Path 15: 19 29 34 7 17 16 10 8 20 11 33 15 18 28 27 5 14 31 -9 -21 -12 -22
## Path 16: 20 29 34 7 17 16 10 19 8 11 33 15 18 28 27 5 14 31 -9 -21 -12 -22
## Path 17: 21 29 34 7 17 16 10 8 19 11 18 15 33 28 27 14 5 20 -31 -12 -9
## Path 18: 27 29 34 7 16 17 10 8 11 20 19 18 33 28 15 5 14 31 -9 -21 -12 -22
## Path 19: 28 34 29 7 17 16 10 8 11 19 20 15 18 33 27 5 14 31 -9 -21 -12 -22
## Path 20: 29 34 7 17 16 10 8 11 19 20 33 15 18 28 27 5 14 31 -9 -21 -12 -22
## Path 21: 31 34 7 29 17 16 10 8 11 19 20 33 15 18 28 27 5 14 -9 -21 -12 -22
## Path 22: 33 29 7 17 16 10 34 8 11 19 20 15 18 28 27 5 14 31 -9 -21 -12 -22
## Path 23: 34 29 7 17 16 10 8 11 19 20 33 15 18 28 27 5 14 31 -9 -21 -12 -22
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 8.671951 -189222.2 43661 17
## spec 2: 8.687761 -189572.7 43661 16
## spec 3: 8.687266 -189556.5 43661 17
## spec 4: 8.692836 -189683.5 43661 16
## spec 5: 8.686429 -189543.6 43661 16
## spec 6: 8.682763 -189463.6 43661 16
##
## Retained regressors (final model):
##
## vconst arch1 arch2 arch4 arch5 arch8 arch11 arch12 arch20 arch21 arch22 arch23 arch24 logEqWMA(12) dk1_wind_fcast dk1_no2 no2_dk1
dk1_vmod %>% plot
data_dk2 %>%
ggplot(aes(x = date, y = dk2_price)) +
geom_line(linewidth = 0.1) +
labs(main = "DK2: Hourly Electricity Prices")
data_dk2 %>% arrange(date, hour) %>% identical(data_dk2)
## [1] TRUE
# Same spec as above with appropriate corrections to the regressors
dk2_mod <- arx(data_dk2$dk2_price,
arch = 1:24,
vxreg = as.matrix(data_dk2[c("dk2_load_fcast", "dk2_wind_fcast",
"dk2_se4","dk2_se4_2")]),
log.ewma = c(12, 24, 168))
# Perform gets model selection over the log-variance model above
dk2_vmod <- getsv(dk2_mod, t.pval = 0.001, ar.LjungB = NULL)
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 2.2187e+00 4.4496e-02 2486.3454 < 2.2e-16 ***
## arch1 2 0 6.2910e-01 4.8220e-03 130.4648 < 2.2e-16 ***
## arch2 3 0 3.0162e-04 5.6846e-03 0.0531 0.957685
## arch3 4 0 -1.2263e-02 5.6794e-03 -2.1592 0.030839 *
## arch4 5 0 -1.2063e-02 5.6739e-03 -2.1260 0.033507 *
## arch5 6 0 -5.9613e-03 5.6698e-03 -1.0514 0.293074
## arch6 7 0 -1.5173e-02 5.6686e-03 -2.6767 0.007438 **
## arch7 8 0 1.8626e-03 5.6688e-03 0.3286 0.742487
## arch8 9 0 -1.9672e-03 5.6704e-03 -0.3469 0.728651
## arch9 10 0 -4.3919e-03 5.6709e-03 -0.7745 0.438667
## arch10 11 0 1.0484e-02 5.6759e-03 1.8472 0.064731 .
## arch11 12 0 -2.7936e-02 5.6785e-03 -4.9196 8.702e-07 ***
## arch12 13 0 -1.6450e-02 5.6647e-03 -2.9040 0.003686 **
## arch13 14 0 9.6957e-03 5.6439e-03 1.7179 0.085822 .
## arch14 15 0 2.6291e-03 5.6485e-03 0.4654 0.641614
## arch15 16 0 4.4085e-04 5.6506e-03 0.0780 0.937815
## arch16 17 0 -1.3189e-03 5.6509e-03 -0.2334 0.815451
## arch17 18 0 4.9549e-03 5.6517e-03 0.8767 0.380651
## arch18 19 0 -1.5177e-03 5.6527e-03 -0.2685 0.788322
## arch19 20 0 -3.0555e-04 5.6523e-03 -0.0541 0.956889
## arch20 21 0 1.6525e-02 5.6521e-03 2.9237 0.003460 **
## arch21 22 0 1.6383e-02 5.6523e-03 2.8984 0.003753 **
## arch22 23 0 3.1062e-02 5.6520e-03 5.4958 3.910e-08 ***
## arch23 24 0 8.3581e-02 5.6530e-03 14.7851 < 2.2e-16 ***
## arch24 25 0 1.0642e-01 4.7691e-03 22.3151 < 2.2e-16 ***
## logEqWMA(12) 26 0 1.8053e-01 1.6245e-02 11.1126 < 2.2e-16 ***
## logEqWMA(24) 27 0 -7.4563e-02 1.7611e-02 -4.2339 2.302e-05 ***
## logEqWMA(168) 28 0 2.2178e-02 9.5550e-03 2.3211 0.020285 *
## dk2_load_fcast 29 0 -1.0045e-05 1.9782e-05 -0.5078 0.611615
## dk2_wind_fcast 30 0 1.3429e-04 3.0722e-05 4.3712 1.239e-05 ***
## dk2_se4 31 0 7.6436e-06 2.1887e-05 0.3492 0.726915
## dk2_se4_2 32 0 -1.1370e-04 1.6364e-05 -6.9482 3.752e-12 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 1633.88530 1 0
## Ljung-Box ARCH(25) 0.60547 25 1
## 22 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
##
## Path 1: 3 20 16 17 19 8 9 31 15 29 18 10 6 11 28 4 14 13 22 -27
## Path 2: 4 20 16 17 9 8 31 19 29 15 10 18 3 6 11 28 14 13 22 -27
## Path 3: 5 3 20 16 17 9 8 31 19 15 29 10 18 11 6 28 14 13 22 -27
## Path 4: 6 16 20 3 17 8 9 31 19 15 29 10 18 11 28 4 14 13 22 -27
## Path 5: 7 20 16 3 17 19 31 9 15 29 18 10 8 11 5 28 14 13 22 -27
## Path 6: 8 3 20 16 17 9 19 31 15 29 18 10 6 11 28 4 14 13 22 -27
## Path 7: 9 20 3 16 8 17 19 31 15 29 18 10 6 11 28 4 14 13 22 -27
## Path 8: 10 3 20 16 17 8 19 31 15 29 9 18 6 11 28 4 14 13 22 -27
## Path 9: 11 3 10 20 16 17 8 9 19 31 15 29 18 6 28 4 14 13 22 -27
## Path 10: 13 3 16 20 17 9 8 19 31 14 29 18 10 6 15 11 28 4 22 -27
## Path 11: 14 3 20 16 17 8 9 31 19 29 18 10 6 11 15 13 28 4 22 -27
## Path 12: 15 3 20 17 16 8 9 19 31 29 18 10 6 11 28 4 14 13 22 -27
## Path 13: 16 3 20 17 19 8 9 31 15 29 18 10 6 11 28 4 14 13 22 -27
## Path 14: 17 16 3 20 19 8 9 31 15 29 18 10 6 11 28 4 14 13 22 -27
## Path 15: 18 20 3 16 19 17 9 8 31 29 15 10 6 11 28 4 14 13 22 -27
## Path 16: 19 3 16 20 17 8 9 31 15 29 18 10 6 11 28 4 14 13 22 -27
## Path 17: 20 3 16 17 19 8 9 31 15 29 18 10 6 11 28 4 14 13 22 -27
## Path 18: 21 3 16 19 17 8 9 31 15 29 18 10 6 11 20 28 4 14 13 -27
## Path 19: 22 16 3 20 17 9 8 19 31 15 29 18 10 6 11 28 4 14 13 -27
## Path 20: 28 3 20 16 29 17 8 9 19 15 31 18 10 6 11 4 14 13 22 -27
## Path 21: 29 20 3 16 17 19 8 9 31 15 18 10 6 11 28 4 14 13 22 -27
## Path 22: 31 20 3 16 17 19 8 9 15 29 18 10 6 11 28 4 14 13 22 -27
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 9.078499 -198118.7 43661 13
## spec 2: 9.107696 -198756.1 43661 13
## spec 3: 9.109620 -198798.1 43661 13
## spec 4: 9.077464 -198096.1 43661 13
##
## Retained regressors (final model):
##
## vconst arch1 arch4 arch6 arch11 arch21 arch22 arch23 arch24 logEqWMA(12) logEqWMA(24) dk2_wind_fcast dk2_se4_2
dk2_vmod %>% plot
Again, in the specification looking at weekly price volatility the dependent variable of interest is the standard deviation of daily prices per week. We have the advantage of being able to model the volatility of daily prices directly with gets.
Pulled from replication data available at:https://doi-org.ezproxy-prd.bodleian.ox.ac.uk/10.1016/j.eneco.2016.12.019
# Required including "here("code/rintamaki_replication/data/" to data read commands in the listed files
source(here("code/rintamaki_replication/models/read_weekly_data.R"))
weekly_forms <- list(
# SPECS FOR DK1
list(vol_dk1, wind_dk1, 1, 0, 0, 1, 4),
list(fwd1(vol_dk1), cbind(fwd1(wind_dk1), diff(exim_dk1)), 1, 0, 0, 1, 4),
list(vol_dk1, wind_std_dk1, 1, 0, 0, 1, 4),
# SPECS FOR DK2
list(vol_dk2, wind_dk2, 1, 0, 0, 1, 4),
list(vol_dk2, wind_std_dk2, 1, 0, 0, 1, 4),
# SPECS FOR DE
list(fwd1(vol_de), diff(wind_de), 1, 0, 0, 0, 4),
list(fwd1(vol_de), diff(solar_de), 1, 0, 0, 0, 4),
list(vol_de, res_de, 1, 0, 0, 0, 4),
list(fwd1(vol_de), cbind(diff(wind_de), fwd1(exim_de)), 1, 0, 0, 0, 4))
weekly_res <- lapply(weekly_forms, function(x) do.call(fitModel, x))
weekly_res %>%
modelsummary
| (1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | |
|---|---|---|---|---|---|---|---|---|---|
| ar1 | 0.307 | 0.304 | 0.303 | 0.345 | 0.346 | 0.168 | 0.206 | 0.173 | 0.156 |
| (0.059) | (0.060) | (0.059) | (0.060) | (0.060) | (0.082) | (0.079) | (0.080) | (0.084) | |
| sma1 | 0.199 | 0.203 | 0.188 | 0.171 | 0.150 | ||||
| (0.062) | (0.063) | (0.061) | (0.068) | (0.067) | |||||
| intercept | 0.402 | 0.522 | −0.593 | 1.317 | 0.760 | 1.967 | 1.968 | 0.764 | 1.941 |
| (0.474) | (0.526) | (0.444) | (0.390) | (0.371) | (0.040) | (0.042) | (1.071) | (0.052) | |
| ext | 0.182 | 0.365 | 0.062 | 0.184 | 0.105 | −0.171 | 0.132 | ||
| (0.071) | (0.073) | (0.072) | (0.076) | (0.059) | (0.113) | (0.117) | |||
| ext1 | 0.164 | 0.110 | |||||||
| (0.079) | (0.060) | ||||||||
| ext2 | 0.041 | 0.028 | |||||||
| (0.076) | (0.037) | ||||||||
| Num.Obs. | 261 | 260 | 261 | 261 | 261 | 155 | 155 | 156 | 155 |
| AIC | 429.4 | 430.3 | 412.0 | 500.6 | 495.5 | 173.0 | 174.0 | 175.7 | 174.4 |
| BIC | 447.2 | 451.6 | 429.8 | 518.4 | 513.3 | 185.1 | 186.1 | 187.9 | 189.6 |
| RMSE | 0.54 | 0.54 | 0.52 | 0.62 | 0.61 | 0.41 | 0.41 | 0.41 | 0.41 |
for(cty in c('dk1', 'dk2', 'de')){
temp <- read_xlsx(here('code/rintamaki_replication/data/raw_data.xlsx'), sheet = cty) %>%
clean_names
assign(paste0("data_", cty), temp)
}
df_list <- list("data_de" = data_de, "data_dk1" = data_dk1, "data_dk2" = data_dk2)
for(n_df in names(df_list)){
df <- df_list[[n_df]]
temp <- df %>%
tibble %>%
# Certain days in October have multiple values for hour one across all countries...not sure why.
# Below I take the average of the duplicate observations but might be worth looking into why this is the case
group_by(date, hour) %>%
summarise(across(names(df)[!(names(df) %in% c("date", "hour", "month"))], ~mean(., na.rm = TRUE))) %>%
# Daily average price
group_by(date) %>%
select(-c("hour")) %>%
summarise(across(names(df)[!(names(df) %in% c("date", "hour", "month"))], ~mean(., na.rm = TRUE)))
assign(paste0("daily_", n_df), temp)
}
## `summarise()` has grouped output by 'date'. You can override using the
## `.groups` argument.
## `summarise()` has grouped output by 'date'. You can override using the
## `.groups` argument.
## `summarise()` has grouped output by 'date'. You can override using the
## `.groups` argument.
daily_data_de %>%
ggplot(aes(x = date, y = de_price)) +
geom_line(linewidth = 0.1) +
labs(main = "Germany: Daily Electricity Prices")
daily_data_de %>% arrange(date) %>% identical(daily_data_de)
## [1] TRUE
# equally-weighted moving averages are incorporated to account for multi-day moving averages 2-, 5-, 7-, 14-day moving averages
# Might want to consider re-incorporating the seasonality dimension as well
daily_de_mod <- arx(daily_data_de$de_price,
# Include 14 ARCH terms to be selected over (two-week period)
# in theory, the ARHC(14) would proxy the seasonal AR term?
arch = 1:14,
# Additional regressors to select over (only wind forecasts, solar forecasts, and imports between Germany and France are available at hourly frequency in the replication data
# Worth doing additional data scoping
# Also perhaps worth including additional indicators for time of day (assuming this variation is not mopped up by the moving average terms)
vxreg = as.matrix(daily_data_de[c('de_load_fcast', 'de_wind_fcast', 'de_solar_fcast', 'de_fr', 'fr_de')]),
# As in Rintamaki et al. the below line incorporates moving average terms for the two-day, 5-day, one-week, and two-week prices
log.ewma = c(2, 5, 7, 14))
# Seasonal moving average terms are not yet incorporated here as they are in Rintamaki et al. Rather we might want to consider the seasonal moving average to have a periodicity of X hours (moving average over the same time of day)
# Perform gets model selection over the log-variance model above
daily_de_vmod <- getsv(daily_de_mod, t.pval = 0.001, ar.LjungB = NULL)
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 4.0532e+00 8.8546e-01 20.9532 4.706e-06 ***
## arch1 2 0 9.7999e-02 4.5964e-02 2.1321 0.0332313 *
## arch2 3 0 -7.6878e-02 4.5877e-02 -1.6757 0.0940835 .
## arch3 4 0 -6.0339e-02 3.4175e-02 -1.7656 0.0777545 .
## arch4 5 0 5.4458e-03 3.4362e-02 0.1585 0.8741043
## arch5 6 0 -7.6844e-02 3.3903e-02 -2.2666 0.0236161 *
## arch6 7 0 -1.7623e-02 3.4680e-02 -0.5082 0.6114385
## arch7 8 0 1.2392e-01 3.4654e-02 3.5760 0.0003647 ***
## arch8 9 0 -3.5032e-03 3.2051e-02 -0.1093 0.9129856
## arch9 10 0 -7.5057e-02 3.2313e-02 -2.3228 0.0203772 *
## arch10 11 0 -1.8537e-02 3.2130e-02 -0.5769 0.5641108
## arch11 12 0 1.0148e-02 3.2372e-02 0.3135 0.7539700
## arch12 13 0 1.9929e-02 3.2315e-02 0.6167 0.5375455
## arch13 14 0 5.1869e-02 3.2050e-02 1.6184 0.1058847
## arch14 15 0 9.6728e-02 3.1738e-02 3.0477 0.0023631 **
## logEqWMA(2) 16 0 1.7453e-01 1.0586e-01 1.6487 0.0994972 .
## logEqWMA(5) 17 0 -4.6089e-01 2.0604e-01 -2.2369 0.0254993 *
## logEqWMA(7) 18 0 9.8277e-01 2.7409e-01 3.5855 0.0003518 ***
## logEqWMA(14) 19 0 -3.2639e-01 2.2565e-01 -1.4465 0.1483359
## de_load_fcast 20 0 -1.7656e-06 1.2515e-05 -0.1411 0.8878323
## de_wind_fcast 21 0 1.3089e-06 1.6235e-05 0.0806 0.9357549
## de_solar_fcast 22 0 -1.8519e-04 3.7614e-05 -4.9234 9.863e-07 ***
## de_fr 23 0 -3.5686e-04 1.3266e-04 -2.6900 0.0072587 **
## fr_de 24 0 -2.2958e-05 2.4425e-04 -0.0940 0.9251325
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 229.0275 1 0.00000
## Ljung-Box ARCH(15) 2.4452 15 0.99989
## 20 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
##
## Path 1: 2 24 20 21 5 9 12 7 13 11 19 14 6 4 15
## Path 2: 3 21 20 24 9 5 12 7 13 16 11 19 14 4 6 10
## Path 3: 4 20 9 24 21 5 12 7 13 11 19 14 6 3 16 10
## Path 4: 5 21 9 24 20 12 7 11 13 19 14 3 16 4 6 10
## Path 5: 6 9 20 24 21 5 13 12 11 7 14 19 4 3 16 10
## Path 6: 7 24 9 21 5 20 12 11 13 19 14 3 16 4 6 10
## Path 7: 9 21 24 20 5 12 7 11 13 19 14 3 16 4 6 10
## Path 8: 10 24 21 20 5 9 7 12 11 13 16 3 14 6 4 19
## Path 9: 11 9 24 21 5 20 12 7 13 19 14 3 16 4 6 10
## Path 10: 12 21 24 20 9 5 7 11 13 19 14 3 16 4 6 10
## Path 11: 13 21 24 5 9 20 12 7 11 19 14 3 16 4 6 10
## Path 12: 14 21 20 24 5 12 7 9 11 13 19 3 16 4 6 10
## Path 13: 15 21 20 12 24 9 5 13 7 19 11 3 16 14 4 6
## Path 14: 16 21 9 5 24 20 12 13 7 11 3 19 14 4 6 10
## Path 15: 17 9 24 21 12 7 13 5 11 20 16 3 19 14 6 18 4
## Path 16: 19 21 24 20 12 13 5 7 9 11 14 3 16 4 6 10
## Path 17: 20 21 24 9 5 12 7 11 13 19 14 3 16 4 6 10
## Path 18: 21 9 24 20 5 12 7 11 13 19 14 3 16 4 6 10
## Path 19: 23 5 9 12 20 11 7 13 21 19 14 3 16 4 6 24
## Path 20: 24 9 21 20 5 12 7 11 13 19 14 3 16 4 6 10
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 7.651125 -4107.819 1082 9
## spec 2: 7.620244 -4094.606 1082 8
## spec 3: 7.625762 -4097.591 1082 8
## spec 4: 7.696568 -4139.390 1082 7
## spec 5: 7.621981 -4095.545 1082 8
##
## Retained regressors (final model):
##
## vconst arch1 arch7 arch14 logEqWMA(5) logEqWMA(7) de_solar_fcast de_fr
daily_de_vmod %>% plot
daily_data_dk1 %>%
ggplot(aes(x = date, y = dk1_price)) +
geom_line(linewidth = 0.1) +
labs(main = "DK1: Daily Electricity Prices")
daily_data_dk1 %>% arrange(date) %>% identical(daily_data_dk1)
## [1] TRUE
# Same spec as above with appropriate corrections to the regressors
daily_dk1_mod <- arx(daily_data_dk1$dk1_price,
mc = TRUE,
arch = 1:14,
vxreg = as.matrix(daily_data_dk1[c("dk1_load_fcast", "dk1_wind_fcast", "dk1_no2", "no2_dk1", "dk1_se3", "se3_dk1")]),
log.ewma = c(2, 5, 7, 14))
# Perform gets model selection over the log-variance model above
daily_dk1_vmod <- getsv(daily_dk1_mod, t.pval = 0.001, ar.LjungB = NULL)
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 2.9178e+00 4.1339e-01 49.8190 1.686e-12 ***
## arch1 2 0 1.9989e-01 3.6222e-02 5.5186 3.916e-08 ***
## arch2 3 0 -7.8018e-03 3.7406e-02 -0.2086 0.834806
## arch3 4 0 -7.7115e-03 2.6489e-02 -0.2911 0.770988
## arch4 5 0 3.6879e-02 2.7116e-02 1.3600 0.173986
## arch5 6 0 4.9349e-02 2.6936e-02 1.8321 0.067102 .
## arch6 7 0 6.8063e-02 2.6755e-02 2.5440 0.011044 *
## arch7 8 0 1.0541e-01 2.7226e-02 3.8717 0.000112 ***
## arch8 9 0 8.1658e-03 2.4635e-02 0.3315 0.740326
## arch9 10 0 2.0706e-02 2.4692e-02 0.8386 0.401808
## arch10 11 0 9.5798e-03 2.4505e-02 0.3909 0.695892
## arch11 12 0 -4.8314e-02 2.4531e-02 -1.9695 0.049047 *
## arch12 13 0 3.2894e-02 2.4638e-02 1.3351 0.182019
## arch13 14 0 2.2363e-02 2.4645e-02 0.9074 0.364330
## arch14 15 0 6.1874e-02 2.3742e-02 2.6061 0.009234 **
## logEqWMA(2) 16 0 2.2986e-01 8.5741e-02 2.6809 0.007411 **
## logEqWMA(5) 17 0 -6.7038e-02 1.4189e-01 -0.4725 0.636658
## logEqWMA(7) 18 0 7.5677e-02 1.5598e-01 0.4852 0.627613
## logEqWMA(14) 19 0 -5.8125e-02 1.0396e-01 -0.5591 0.576172
## dk1_load_fcast 20 0 -2.5975e-04 1.4978e-04 -1.7342 0.083048 .
## dk1_wind_fcast 21 0 2.1748e-04 7.5974e-05 2.8626 0.004251 **
## dk1_no2 22 0 -1.9722e-04 2.1216e-04 -0.9296 0.352704
## no2_dk1 23 0 -4.6579e-04 2.0719e-04 -2.2482 0.024687 *
## dk1_se3 24 0 6.7955e-04 2.9997e-04 2.2654 0.023607 *
## se3_dk1 25 0 -3.5859e-04 2.7468e-04 -1.3055 0.191907
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 338.7984 1 0.00000
## Ljung-Box ARCH(15) 4.9475 15 0.99256
## 22 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
##
## Path 1: 3 4 9 11 19 18 17 14 10 22 25 5 13 12 20 6 24
## Path 2: 4 3 9 11 19 18 17 14 10 22 25 5 13 12 20 6 24
## Path 3: 5 17 3 4 9 11 18 19 14 22 10 25 13 12 20 6 24
## Path 4: 6 17 3 9 11 4 19 18 14 22 10 25 20 13 12 5 24
## Path 5: 7 3 4 11 9 19 22 10 14 25 17 18 5 20 12 13 24 6
## Path 6: 9 3 4 11 19 18 17 14 10 22 25 5 13 12 20 6 24
## Path 7: 10 3 4 19 18 9 11 17 14 22 25 5 13 12 20 6 24
## Path 8: 11 3 4 9 19 18 17 14 10 22 25 5 13 12 20 6 24
## Path 9: 12 11 3 4 9 17 18 10 19 14 22 13 5 25 20 6 24
## Path 10: 13 3 4 19 18 9 11 17 10 22 14 25 5 12 20 6 24
## Path 11: 14 3 4 11 19 9 18 17 10 22 25 5 13 12 20 6 24
## Path 12: 15 19 3 18 11 4 9 17 22 10 5 25 13 12 20 14 6 24
## Path 13: 16 11 18 19 9 4 5 14 22 10 25 17 20 13 12 6 24
## Path 14: 17 3 18 9 11 4 19 14 10 22 25 5 13 12 20 6 24
## Path 15: 18 17 3 9 11 4 19 14 10 22 25 5 13 12 20 6 24
## Path 16: 19 3 18 9 4 11 17 14 10 22 25 5 13 12 20 6 24
## Path 17: 20 3 9 4 11 19 18 17 14 10 22 25 5 13 12 6 24
## Path 18: 21 4 11 9 19 18 3 17 14 22 10 5 25 20 13 12 6
## Path 19: 22 3 9 4 11 19 18 17 14 10 25 5 13 12 20 6 24
## Path 20: 23 3 4 9 11 18 19 17 22 14 10 5 13 12 25 20 6 24
## Path 21: 24 3 9 11 4 19 18 17 22 10 14 5 13 12 20 25 6
## Path 22: 25 3 9 4 11 19 18 17 14 22 10 5 13 12 20 6 24
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 7.938157 -7161.962 1812 8
## spec 2: 7.935530 -7163.332 1812 7
## spec 3: 7.939540 -7166.966 1812 7
## spec 4: 8.112107 -7319.561 1812 8
## spec 5: 7.907051 -7133.780 1812 8
## spec 6: 7.927551 -7156.104 1812 7
##
## Retained regressors (final model):
##
## vconst arch1 arch6 arch7 arch14 logEqWMA(2) no2_dk1 dk1_se3
daily_dk1_vmod %>% plot
daily_data_dk2 %>%
ggplot(aes(x = date, y = dk2_price)) +
geom_line(linewidth = 0.1) +
labs(main = "DK2: Daily Electricity Prices")
data_dk2 %>% arrange(date) %>% identical(data_dk2)
## [1] TRUE
# Same spec as above with appropriate corrections to the regressors
daily_dk2_mod <- arx(daily_data_dk2$dk2_price,
arch = 1:14,
vxreg = as.matrix(daily_data_dk2[c("dk2_load_fcast", "dk2_wind_fcast",
"dk2_se4","dk2_se4_2")]),
log.ewma = c(2, 5, 7, 14))
# Perform gets model selection over the log-variance model above
# Requires turning off both ARCH and AR Ljung-Box test - could play around with lag and pvalues
daily_dk2_vmod <- getsv(daily_dk2_mod, t.pval = 0.001, ar.LjungB = NULL, arch.LjungB = NULL)
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 2.2735e+00 3.8929e-01 34.1078 5.214e-09 ***
## arch1 2 0 1.3671e-01 3.3986e-02 4.0226 5.995e-05 ***
## arch2 3 0 -4.5254e-02 3.4873e-02 -1.2977 0.1945594
## arch3 4 0 -2.0508e-02 2.5950e-02 -0.7903 0.4294672
## arch4 5 0 -5.8071e-03 2.6551e-02 -0.2187 0.8269008
## arch5 6 0 1.8314e-02 2.6275e-02 0.6970 0.4858772
## arch6 7 0 9.2361e-02 2.6384e-02 3.5007 0.0004755 ***
## arch7 8 0 1.1531e-01 2.7207e-02 4.2383 2.367e-05 ***
## arch8 9 0 2.4652e-02 2.4320e-02 1.0137 0.3108753
## arch9 10 0 -3.4962e-02 2.4402e-02 -1.4327 0.1521057
## arch10 11 0 2.3071e-02 2.4269e-02 0.9506 0.3419114
## arch11 12 0 -4.9334e-02 2.4206e-02 -2.0381 0.0416843 *
## arch12 13 0 -4.4547e-02 2.4239e-02 -1.8378 0.0662560 .
## arch13 14 0 2.0042e-02 2.4108e-02 0.8314 0.4058776
## arch14 15 0 7.0818e-02 2.3395e-02 3.0271 0.0025047 **
## logEqWMA(2) 16 0 2.0253e-01 8.3610e-02 2.4223 0.0155196 *
## logEqWMA(5) 17 0 1.2332e-01 1.5952e-01 0.7731 0.4395699
## logEqWMA(7) 18 0 2.0222e-01 1.9212e-01 1.0526 0.2926653
## logEqWMA(14) 19 0 6.1481e-02 1.2551e-01 0.4899 0.6242875
## dk2_load_fcast 20 0 -6.0738e-04 2.3565e-04 -2.5775 0.0100320 *
## dk2_wind_fcast 21 0 9.9166e-04 2.2613e-04 4.3854 1.225e-05 ***
## dk2_se4 22 0 -4.1942e-06 2.3542e-04 -0.0178 0.9857876
## dk2_se4_2 23 0 -7.3489e-04 1.5501e-04 -4.7410 2.295e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 488.750 1 0.00000
## Ljung-Box ARCH(15) 12.608 15 0.63254
## 17 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
##
## Path 1: 3 22 5 19 17 4 14 11 6 9 10 13 16 20 12 -15
## Path 2: 4 22 5 17 19 14 6 11 9 10 3 13 16 20 12 -15
## Path 3: 5 22 19 6 4 17 14 11 9 10 3 13 16 20 12 -15
## Path 4: 6 22 5 19 4 17 14 11 9 10 3 13 16 20 12 -15
## Path 5: 9 22 5 19 17 4 14 6 11 10 3 13 16 20 12 -15
## Path 6: 10 22 19 5 6 11 4 17 9 14 3 13 16 20 12 -15
## Path 7: 11 22 5 4 17 19 14 6 9 10 3 13 16 20 12 -15
## Path 8: 12 19 22 5 17 11 4 14 6 9 10 3 13 16 20 -15
## Path 9: 13 22 19 5 6 14 17 4 11 9 10 3 16 20 12 -15
## Path 10: 14 22 5 19 17 4 6 11 9 10 3 13 16 20 12 -15
## Path 11: 15 5 22 17 4 11 6 9 10 19 13 3 14 12 16 -20
## Path 12: 16 22 6 19 3 5 14 11 10 4 17 9 13 20 12 -15
## Path 13: 17 5 22 19 4 14 6 11 9 10 3 13 16 20 12 -15
## Path 14: 18 22 5 6 14 11 4 9 3 10 19 13 16 20 12
## Path 15: 19 22 5 6 4 17 14 11 9 10 3 13 16 20 12 -15
## Path 16: 20 19 5 22 17 4 14 11 6 9 10 3 13 16 12 -15
## Path 17: 22 5 19 6 4 17 14 11 9 10 3 13 16 20 12 -15
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 7.934909 -7159.019 1812 8
## spec 2: 7.971088 -7191.797 1812 8
## spec 3: 7.951754 -7174.280 1812 8
##
## Retained regressors (final model):
##
## vconst arch1 arch6 arch7 arch14 logEqWMA(7) dk2_wind_fcast dk2_se4_2
daily_dk2_vmod %>% plot
Pulled from replication data available at:https://doi-org.ezproxy-prd.bodleian.ox.ac.uk/10.1016/j.eneco.2016.12.019
# Required including "here("code/rintamaki_replication/data/" to data read commands in the listed files
source(here("code/rintamaki_replication/models/read_intraday_data.R"))
intraday_forms <- list(
list(price_op1_dk1, cbind(wind_op1_dk1, exim_op1_dk1), 2, 1, 1, 1, 7),
list(price_p_dk1, cbind(wind_p_dk1, exim_p_dk1), 2, 1, 1, 1, 7),
list(price_op2_dk1, cbind(wind_op2_dk1, exim_op2_dk1), 2, 1, 1, 1, 7),
list(price_p_dk2, cbind(wind_p_dk2, exim_p_dk2), 2, 1, 1, 1, 7),
list(price_op2_dk2, cbind(wind_op2_dk2, exim_op2_dk2), 2, 1, 1, 1, 7),
list(price_op1_de, cbind(wind_op1_de, exim_op1_de), 2, 1, 1, 1, 7),
list(price_p_de, cbind(wind_p_de, exim_p_de), 2, 1, 1, 1, 7),
list(price_op2_de, cbind(wind_op2_de, exim_op2_de), 2, 1, 1, 1, 7),
list(fwd1(price_p_de), cbind(diff(solar_p_de), fwd1(exim_p_de)), 2, 1, 1, 1, 7),
list(price_p_de, cbind(res_p_de, exim_p_de), 2, 1, 1, 1, 7))
intraday_res <- lapply(intraday_forms, function(x) do.call(fitModel, x))
modelsummary(intraday_res)
| (1) | (2) | (3) | (4) | (5) | (6) | (7) | (8) | (9) | (10) | |
|---|---|---|---|---|---|---|---|---|---|---|
| ar1 | 1.151 | 1.173 | 1.062 | 1.243 | 1.071 | −0.556 | 0.973 | 0.591 | 0.955 | 0.882 |
| (0.042) | (0.042) | (0.039) | (0.046) | (0.038) | (0.068) | (0.100) | (0.145) | (0.151) | (0.129) | |
| ar2 | −0.192 | −0.224 | −0.093 | −0.291 | −0.107 | 0.295 | −0.119 | 0.099 | −0.139 | −0.080 |
| (0.034) | (0.034) | (0.035) | (0.038) | (0.034) | (0.043) | (0.054) | (0.065) | (0.077) | (0.055) | |
| ma1 | −0.791 | −0.762 | −0.722 | −0.750 | −0.721 | 0.922 | −0.674 | −0.343 | −0.602 | −0.645 |
| (0.031) | (0.033) | (0.029) | (0.037) | (0.029) | (0.058) | (0.093) | (0.145) | (0.145) | (0.124) | |
| sar1 | 0.948 | 0.954 | 0.970 | 0.961 | 0.963 | 0.917 | 0.934 | 0.961 | 0.928 | 0.932 |
| (0.020) | (0.011) | (0.013) | (0.010) | (0.014) | (0.023) | (0.013) | (0.013) | (0.015) | (0.014) | |
| sma1 | −0.879 | −0.799 | −0.936 | −0.791 | −0.919 | −0.734 | −0.591 | −0.817 | −0.609 | −0.566 |
| (0.031) | (0.024) | (0.019) | (0.023) | (0.021) | (0.041) | (0.033) | (0.027) | (0.036) | (0.036) | |
| intercept | 4.147 | 4.169 | 4.041 | 4.076 | 3.930 | 5.879 | 4.981 | 5.172 | 3.704 | 7.037 |
| (0.096) | (0.084) | (0.077) | (0.112) | (0.075) | (0.138) | (0.113) | (0.081) | (0.080) | (0.161) | |
| wind_op1_dk1 | −0.109 | |||||||||
| (0.009) | ||||||||||
| exim_op1_dk1 | −0.145 | |||||||||
| (0.018) | ||||||||||
| wind_p_dk1 | −0.073 | |||||||||
| (0.005) | ||||||||||
| exim_p_dk1 | −0.107 | |||||||||
| (0.009) | ||||||||||
| wind_op2_dk1 | −0.065 | |||||||||
| (0.005) | ||||||||||
| exim_op2_dk1 | −0.087 | |||||||||
| (0.009) | ||||||||||
| wind_p_dk2 | −0.057 | |||||||||
| (0.004) | ||||||||||
| exim_p_dk2 | −0.066 | |||||||||
| (0.012) | ||||||||||
| wind_op2_dk2 | −0.054 | |||||||||
| (0.005) | ||||||||||
| exim_op2_dk2 | −0.047 | |||||||||
| (0.012) | ||||||||||
| wind_op1_de | −0.307 | |||||||||
| (0.016) | ||||||||||
| exim_op1_de | 0.044 | |||||||||
| (0.011) | ||||||||||
| wind_p_de | −0.153 | |||||||||
| (0.009) | ||||||||||
| exim_p_de | 0.019 | 0.028 | ||||||||
| (0.007) | (0.007) | |||||||||
| wind_op2_de | −0.187 | |||||||||
| (0.008) | ||||||||||
| exim_op2_de | 0.044 | |||||||||
| (0.006) | ||||||||||
| ext1 | −0.053 | |||||||||
| (0.014) | ||||||||||
| ext2 | 0.010 | |||||||||
| (0.008) | ||||||||||
| res_p_de | −0.360 | |||||||||
| (0.016) | ||||||||||
| Num.Obs. | 1813 | 1813 | 1813 | 1816 | 1816 | 1081 | 1081 | 1081 | 1080 | 1081 |
| AIC | 794.5 | −1195.8 | −1329.9 | −1031.8 | −840.6 | 603.6 | −221.5 | −827.0 | −0.6 | −377.6 |
| BIC | 844.0 | −1146.3 | −1280.4 | −982.2 | −791.1 | 648.5 | −176.6 | −782.2 | 44.3 | −332.7 |
| RMSE | 0.30 | 0.17 | 0.17 | 0.18 | 0.19 | 0.32 | 0.22 | 0.16 | 0.24 | 0.20 |
for(cty in c("de","dk1", "dk2")){
temp <- read.table(here(paste0("code/rintamaki_replication/data/", cty, "_intraday.txt")), header=TRUE) %>%
tibble %>%
mutate(date = dmy(date)) %>%
arrange(date)
assign(paste0("intraday_data_", cty), temp)
}
intraday_data_de %>%
select(date, op1_price, op2_price, p_price) %>%
pivot_longer(cols = !date) %>%
ggplot() +
geom_line(aes(x = date, y = value, color = name), linewidth = 0.1) +
labs(main = "DE: Intraday Electricity Prices")
intraday_data_de %>% arrange(date) %>% identical(intraday_data_de)
## [1] TRUE
for(dep in c("op1_", "op2_", "p_")){
temp <- intraday_data_de %>%
select(date, contains(dep))
print(temp)
dep2 <- as.matrix(temp[paste0(dep, "price")])
vxregs <- as.matrix(temp[!(names(temp) %in% c("date", paste0(dep, "price")))])
temp_mod <- arx(dep2,
ar = 1:14,
vxreg = vxregs,
log.ewma = c(2, 5, 7, 14))
assign(paste0("de_", dep, "mod"), temp_mod)
temp_vmod <- getsv(temp_mod, t.pval = 0.001, ar.LjungB = NULL, arch.LjungB = NULL)
assign(paste0("de_", dep, "vmod"), temp_vmod)
plot(temp_vmod)
}
## # A tibble: 1,081 × 8
## date op1_price op1_load op1_wind op1_res op1_wind_pen op1_res_pen
## <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2012-01-01 2.61 10.5 8.74 8.74 -1.71 -1.71
## 2 2012-01-02 2.08 10.5 9.34 9.34 -1.16 -1.16
## 3 2012-01-03 3.34 10.7 9.29 9.29 -1.45 -1.45
## 4 2012-01-04 2.38 10.7 9.95 9.95 -0.779 -0.779
## 5 2012-01-06 2.76 10.7 9.78 9.78 -0.934 -0.934
## 6 2012-01-07 3.14 10.7 9.47 9.47 -1.19 -1.19
## 7 2012-01-08 1.27 10.6 9.55 9.55 -1.01 -1.01
## 8 2012-01-09 3.64 10.8 8.13 8.13 -2.62 -2.62
## 9 2012-01-10 3.53 10.8 9.28 9.28 -1.48 -1.48
## 10 2012-01-11 3.63 10.8 9.03 9.03 -1.80 -1.80
## # ℹ 1,071 more rows
## # ℹ 1 more variable: op1_exp <dbl>
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 26.983190 7.591860 12.6325 0.0003791 ***
## logEqWMA(2) 2 0 0.262951 0.055182 4.7651 2.155e-06 ***
## logEqWMA(5) 3 0 -0.460613 0.144093 -3.1966 0.0014322 **
## logEqWMA(7) 4 0 0.597089 0.174600 3.4197 0.0006511 ***
## logEqWMA(14) 5 0 0.170359 0.121342 1.4040 0.1606291
## op1_load 6 0 0.906020 4.571494 0.1982 0.8429358
## op1_wind 7 0 -9.622936 9.422003 -1.0213 0.3073371
## op1_res 8 0 6.194747 9.805404 0.6318 0.5276766
## op1_wind_pen 9 0 10.259600 11.019319 0.9311 0.3520404
## op1_res_pen 10 0 -6.413083 11.510264 -0.5572 0.5775363
## op1_exp 11 0 0.186567 0.056144 3.3230 0.0009215 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(15) 23.17148 15 0.080566
## Ljung-Box ARCH(1) 0.33314 1 0.563818
## 7 path(s) to search
## Searching: 1 2 3 4 5 6 7
##
## Path 1: 3 6 10 8 4 -11
## Path 2: 5 6 10 8 3
## Path 3: 6 10 8 5 3
## Path 4: 7 6 9 5
## Path 5: 8 6 10 5 3
## Path 6: 9 6 7 5
## Path 7: 10 6 8 5 3
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 0.1695989 -68.41564 1053 6
## spec 2: 0.1832057 -75.57962 1053 6
## spec 3: 0.1950007 -78.30997 1053 7
##
## Retained regressors (final model):
##
## vconst logEqWMA(2) logEqWMA(14) op1_wind op1_wind_pen op1_exp
## # A tibble: 1,081 × 8
## date op2_price op2_load op2_wind op2_res op2_wind_pen op2_res_pen
## <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2012-01-01 3.24 10.7 9.35 9.35 -1.31 -1.31
## 2 2012-01-02 3.62 10.9 9.22 9.22 -1.67 -1.67
## 3 2012-01-03 3.30 10.9 10.0 10.0 -0.861 -0.861
## 4 2012-01-04 3.40 10.9 10.0 10.0 -0.906 -0.906
## 5 2012-01-06 3.78 10.9 9.15 9.15 -1.73 -1.73
## 6 2012-01-07 3.43 10.8 9.60 9.60 -1.20 -1.20
## 7 2012-01-08 3.74 10.8 8.50 8.50 -2.32 -2.32
## 8 2012-01-09 3.77 11.0 9.10 9.10 -1.85 -1.85
## 9 2012-01-10 3.77 11.0 8.77 8.77 -2.21 -2.21
## 10 2012-01-11 3.88 11.0 9.01 9.01 -1.96 -1.96
## # ℹ 1,071 more rows
## # ℹ 1 more variable: op2_exp <dbl>
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 -22.756861 7.590465 8.9885 0.002717 **
## logEqWMA(2) 2 0 0.080081 0.062014 1.2913 0.196874
## logEqWMA(5) 3 0 0.059842 0.164864 0.3630 0.716694
## logEqWMA(7) 4 0 0.248518 0.200493 1.2395 0.215426
## logEqWMA(14) 5 0 0.073629 0.142228 0.5177 0.604791
## op2_load 6 0 11.749422 12.436521 0.9448 0.345005
## op2_wind 7 0 45.681518 59.430292 0.7687 0.442271
## op2_res 8 0 -55.346728 62.659197 -0.8833 0.377279
## op2_wind_pen 9 0 -47.386760 64.435596 -0.7354 0.462254
## op2_res_pen 10 0 57.618481 67.761896 0.8503 0.395349
## op2_exp 11 0 -0.128795 0.064903 -1.9844 0.047471 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(15) 16.099244 15 0.37549
## Ljung-Box ARCH(1) 0.000123 1 0.99115
## 10 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10
##
## Path 1: 2 5 9 10 3 8 11 6
## Path 2: 3 5 9 10 8 2 11 6
## Path 3: 4 9 10 8 2 5 11 6
## Path 4: 5 3 9 10 8 2 11 6
## Path 5: 6 3 5 10 8 2 11 9
## Path 6: 7 3 5 10 8 2 11 6
## Path 7: 8 3 5 7 10 2 11 6
## Path 8: 9 3 5 10 8 2 11 6
## Path 9: 10 7 3 5 8 2 11 6
## Path 10: 11 5 3 7 9 8 2 6
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: -0.7303577 394.9725 1053 3
## spec 2: -0.7303367 394.9614 1053 3
## spec 3: -0.7252047 392.2593 1053 3
## spec 4: -0.7236655 391.4490 1053 3
##
## Retained regressors (final model):
##
## vconst logEqWMA(7) op2_wind
## # A tibble: 1,081 × 10
## date p_price p_load p_wind p_res p_wind_pen p_res_pen p_exp p_solar
## <date> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2012-01-01 2.93 10.6 9.21 9.25 -1.41 -1.37 -0.716 5.88
## 2 2012-01-02 3.91 11.0 9.07 9.13 -1.96 -1.90 -1.8 6.21
## 3 2012-01-03 3.74 11.0 9.94 10.0 -1.10 -1.04 -1.23 7.23
## 4 2012-01-04 3.85 11.0 9.96 10.0 -1.09 -1.04 0.296 7.05
## 5 2012-01-06 3.86 11.0 9.31 9.41 -1.68 -1.58 0.207 7.06
## 6 2012-01-07 3.68 10.9 9.63 9.65 -1.25 -1.23 0.662 5.59
## 7 2012-01-08 3.62 10.8 9.16 9.22 -1.63 -1.57 0.102 6.25
## 8 2012-01-09 4.03 11.1 8.60 8.68 -2.54 -2.47 -0.999 6.06
## 9 2012-01-10 3.99 11.1 8.70 8.86 -2.41 -2.25 -0.548 6.97
## 10 2012-01-11 3.99 11.1 9.12 9.22 -1.99 -1.90 0.992 6.82
## # ℹ 1,071 more rows
## # ℹ 1 more variable: p_solar_pen <dbl>
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 9.056373 9.228539 0.9630 0.32642
## logEqWMA(2) 2 0 0.110686 0.059891 1.8481 0.06487 .
## logEqWMA(5) 3 0 -0.286182 0.154388 -1.8537 0.06407 .
## logEqWMA(7) 4 0 0.379753 0.195660 1.9409 0.05254 .
## logEqWMA(14) 5 0 0.225599 0.160425 1.4063 0.15994
## p_load 6 0 -14.783766 19.062209 -0.7756 0.43819
## p_wind 7 0 31.713581 14.406761 2.2013 0.02793 *
## p_res 8 0 -3.620176 30.150302 -0.1201 0.90445
## p_wind_pen 9 0 -31.650357 14.478575 -2.1860 0.02904 *
## p_res_pen 10 0 3.907697 30.253330 0.1292 0.89725
## p_exp 11 0 -0.078726 0.062948 -1.2506 0.21134
## p_solar 12 0 -14.221736 18.835651 -0.7550 0.45039
## p_solar_pen 13 0 14.115591 18.880614 0.7476 0.45486
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(15) 18.724 15 0.22653628
## Ljung-Box ARCH(1) 13.955 1 0.00018726
## 12 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12
##
## Path 1: 2 8 10 6 3 5 11 9 7
## Path 2: 3 8 10 6 4 11 2 9 7
## Path 3: 4 8 3 10 6 11 2 9 7
## Path 4: 5 8 10 6 11 2 3 9 7
## Path 5: 6 8 10 5 11 2 3 9 7
## Path 6: 7 6 11 9 5 10 2 3 8
## Path 7: 8 10 6 5 11 2 3 9 7
## Path 8: 9 6 11 7 5 10 2 3 8
## Path 9: 10 8 6 5 11 2 3 9 7
## Path 10: 11 8 6 10 5 2 3 9 7
## Path 11: 12 6 13 5 11 2 3 9 7 -8 -10
## Path 12: 13 6 12 5 11 2 3 9 7 -8 -10
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: -0.06084853 45.95555 1053 4
## spec 2: -0.07041061 50.98998 1053 4
## spec 3: -0.05658669 43.71169 1053 4
##
## Retained regressors (final model):
##
## vconst logEqWMA(14) p_solar p_solar_pen
intraday_data_dk1 %>%
select(date, op1_dk1_price, op2_dk1_price, p_dk1_price) %>%
pivot_longer(cols = !date) %>%
ggplot() +
geom_line(aes(x = date, y = value, color = name), linewidth = 0.1) +
labs(main = "DK1: Intraday Electricity Prices")
intraday_data_dk1 %>% arrange(date) %>% identical(intraday_data_dk1)
## [1] TRUE
for(dep in c("op1_dk1_", "op2_dk1_", "p_dk1_")){
temp <- intraday_data_dk1 %>%
select(date, contains(dep))
print(temp)
dep2 <- as.matrix(temp[paste0(dep, "price")])
vxregs <- as.matrix(temp[!(names(temp) %in% c("date", paste0(dep, "price")))])
temp_mod <- arx(dep2,
arch = 1:14,
vxreg = vxregs,
log.ewma = c(2, 5, 7, 14))
assign(paste0("dk1_", dep, "mod"), temp_mod)
temp_vmod <- getsv(temp_mod, t.pval = 0.001, ar.LjungB = NULL, arch.LjungB = NULL)
assign(paste0("dk1_", dep, "vmod"), temp_vmod)
plot(temp_vmod)
}
## # A tibble: 1,813 × 6
## date op1_dk1_price op1_dk1_load op1_dk1_wind op1_dk1_pen op1_dk1_exp
## <date> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2010-01-01 3.40 7.51 5.52 -1.98 1.36
## 2 2010-01-02 3.64 7.53 6.13 -1.40 1.32
## 3 2010-01-03 3.63 7.45 5.04 -2.40 1.26
## 4 2010-01-04 3.57 7.70 5.62 -2.06 1.20
## 5 2010-01-05 3.72 7.78 5.05 -2.73 1.22
## 6 2010-01-06 3.59 7.71 6.80 -0.885 1.31
## 7 2010-01-07 3.65 7.71 6.16 -1.52 1.20
## 8 2010-01-08 3.73 7.73 5.69 -2.04 1.07
## 9 2010-01-09 3.27 7.53 6.65 -0.884 1.37
## 10 2010-01-10 2.71 7.59 7.53 -0.0543 1.37
## # ℹ 1,803 more rows
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 3.94967009 3.13326383 1.5890 0.207467
## arch1 2 0 0.16701611 0.03691295 4.5246 6.452e-06 ***
## arch2 3 0 0.00180207 0.03611419 0.0499 0.960208
## arch3 4 0 0.02867221 0.02595641 1.1046 0.269470
## arch4 5 0 0.07832347 0.02640039 2.9668 0.003050 **
## arch5 6 0 0.04757932 0.02658310 1.7898 0.073651 .
## arch6 7 0 0.07909038 0.02706117 2.9227 0.003515 **
## arch7 8 0 0.11936467 0.02693678 4.4313 9.939e-06 ***
## arch8 9 0 0.06013641 0.02471535 2.4332 0.015066 *
## arch9 10 0 0.00384697 0.02480626 0.1551 0.876775
## arch10 11 0 -0.00663179 0.02477847 -0.2676 0.789005
## arch11 12 0 0.00847630 0.02474596 0.3425 0.731991
## arch12 13 0 -0.01645513 0.02461777 -0.6684 0.503949
## arch13 14 0 -0.00074796 0.02470069 -0.0303 0.975846
## arch14 15 0 0.04897218 0.02402341 2.0385 0.041646 *
## logEqWMA(2) 16 0 0.19734151 0.07679945 2.5696 0.010263 *
## logEqWMA(5) 17 0 0.02446353 0.11852230 0.2064 0.836499
## logEqWMA(7) 18 0 -0.11265405 0.13474672 -0.8360 0.403243
## logEqWMA(14) 19 0 0.00037131 0.09841278 0.0038 0.996990
## op1_dk1_load 20 0 -2.16224468 2.31871110 -0.9325 0.351195
## op1_dk1_wind 21 0 1.73247930 2.42376285 0.7148 0.474833
## op1_dk1_pen 22 0 -1.74817615 2.41868056 -0.7228 0.469910
## op1_dk1_exp 23 0 0.35441960 0.06558171 5.4042 7.388e-08 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 242.0837 1 0.00000
## Ljung-Box ARCH(15) 1.8586 15 0.99998
## 19 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
##
## Path 1: 3 19 14 10 17 11 12 13 21 22 4 18 20 6 15 9
## Path 2: 4 14 19 11 10 3 12 17 13 21 22 18 20 6 15 9
## Path 3: 5 14 11 19 10 3 13 12 21 22 17 18 20 4 15 6
## Path 4: 6 14 19 3 11 10 12 13 21 22 17 18 4 20 15 9
## Path 5: 7 11 3 10 19 14 18 12 13 21 22 17 4 20 15 6 9
## Path 6: 9 14 3 17 11 12 19 13 21 22 10 20 4 18 6 15
## Path 7: 10 14 19 3 17 11 12 13 21 22 4 18 20 6 15 9
## Path 8: 11 14 3 19 10 17 12 13 21 22 4 18 20 6 15 9
## Path 9: 12 14 3 19 10 11 17 13 21 22 4 18 20 6 15 9
## Path 10: 13 3 19 10 17 14 12 11 21 22 4 18 20 6 15 9
## Path 11: 14 19 3 10 17 11 12 13 21 22 4 18 20 6 15 9
## Path 12: 15 3 17 10 11 12 14 13 19 21 22 20 4 18 6 9
## Path 13: 16 19 14 11 12 10 21 22 13 4 18 17 20 6 15 9
## Path 14: 17 19 14 3 10 11 12 13 21 22 4 18 20 6 15 9
## Path 15: 18 3 14 11 10 12 19 13 21 22 17 4 20 6 15 9
## Path 16: 19 14 3 10 17 11 12 13 21 22 4 18 20 6 15 9
## Path 17: 20 14 19 3 17 10 11 12 13 22 21 4 18 6 15 9
## Path 18: 21 14 19 3 10 17 11 12 22 13 4 18 20 6 15 9
## Path 19: 22 14 19 3 10 17 11 12 21 13 4 18 20 6 15 9
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 1.137488 -996.9384 1799 7
## spec 2: 1.066120 -932.7429 1799 7
## spec 3: 1.155852 -1017.2036 1799 6
## spec 4: 1.245907 -1094.4610 1799 7
##
## Retained regressors (final model):
##
## vconst arch1 arch6 arch7 arch8 logEqWMA(2) op1_dk1_exp
## # A tibble: 1,813 × 6
## date op2_dk1_price op2_dk1_load op2_dk1_wind op2_dk1_pen op2_dk1_exp
## <date> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2010-01-01 3.66 7.67 5.91 -1.76 1.37
## 2 2010-01-02 3.75 7.68 6.09 -1.60 -0.28
## 3 2010-01-03 3.70 7.72 5.18 -2.52 0.567
## 4 2010-01-04 3.73 7.91 5.57 -2.32 1.07
## 5 2010-01-05 3.67 7.93 7.05 -0.863 1.15
## 6 2010-01-06 3.85 7.87 6.42 -1.45 -0.393
## 7 2010-01-07 3.85 7.87 5.41 -2.45 0.223
## 8 2010-01-08 3.67 7.89 6.44 -1.44 1.37
## 9 2010-01-09 3.69 7.69 7.39 -0.301 1.37
## 10 2010-01-10 3.78 7.67 7.33 -0.329 1.34
## # ℹ 1,803 more rows
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 7.8498660 3.2599679 5.7983 0.016042 *
## arch1 2 0 0.1597272 0.0355229 4.4965 7.357e-06 ***
## arch2 3 0 -0.0584432 0.0360218 -1.6224 0.104887
## arch3 4 0 0.0039254 0.0264632 0.1483 0.882095
## arch4 5 0 0.0566032 0.0269395 2.1011 0.035771 *
## arch5 6 0 0.0237831 0.0271404 0.8763 0.380985
## arch6 7 0 0.0929221 0.0269126 3.4527 0.000568 ***
## arch7 8 0 0.1727698 0.0273475 6.3176 3.351e-10 ***
## arch8 9 0 0.0247232 0.0249317 0.9916 0.321510
## arch9 10 0 0.0070094 0.0248114 0.2825 0.777586
## arch10 11 0 -0.0068903 0.0248354 -0.2774 0.781476
## arch11 12 0 -0.0014211 0.0247246 -0.0575 0.954170
## arch12 13 0 -0.0301110 0.0247153 -1.2183 0.223267
## arch13 14 0 0.0227127 0.0247411 0.9180 0.358737
## arch14 15 0 0.0565874 0.0238666 2.3710 0.017847 *
## logEqWMA(2) 16 0 0.2439252 0.0795694 3.0656 0.002205 **
## logEqWMA(5) 17 0 0.3357595 0.1364717 2.4603 0.013977 *
## logEqWMA(7) 18 0 -0.1756809 0.1507023 -1.1657 0.243873
## logEqWMA(14) 19 0 -0.0944631 0.1038504 -0.9096 0.363153
## op2_dk1_load 20 0 -0.1811236 4.5993200 -0.0394 0.968591
## op2_dk1_wind 21 0 -0.7718292 4.6806804 -0.1649 0.869044
## op2_dk1_pen 22 0 0.7721362 4.6782446 0.1650 0.868925
## op2_dk1_exp 23 0 0.3234266 0.0516240 6.2650 4.666e-10 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 362.36474 1 0
## Ljung-Box ARCH(15) 0.65534 15 1
## 18 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
##
## Path 1: 3 4 20 12 10 11 6 9 19 14 13 18 5 22 21 16 15
## Path 2: 4 20 12 11 10 6 14 19 9 13 3 18 5 22 21 16 15
## Path 3: 5 20 11 4 12 10 6 14 19 9 13 3 18 22 21 16 15
## Path 4: 6 12 4 20 11 10 14 19 9 13 3 18 5 22 21 16 15
## Path 5: 9 20 12 4 11 10 19 14 6 13 3 18 5 22 21 16 15
## Path 6: 10 20 12 4 11 6 14 19 9 13 3 18 5 22 21 16 15
## Path 7: 11 20 4 12 10 6 14 19 9 13 3 18 5 22 21 16 15
## Path 8: 12 20 4 11 10 6 14 19 9 13 3 18 5 22 21 16 15
## Path 9: 13 20 4 11 10 12 6 14 9 19 3 18 5 22 21 16 15
## Path 10: 14 20 12 4 11 10 19 9 6 13 3 18 5 22 21 16 15
## Path 11: 15 20 12 4 11 10 19 6 9 13 14 3 18 5 22 21 16
## Path 12: 16 12 20 4 10 6 11 3 14 19 9 13 5 18 22 21 15
## Path 13: 17 20 12 10 11 4 9 14 19 18 13 3 6 22 21 15
## Path 14: 18 20 12 11 4 10 6 13 14 9 3 19 5 22 21 16 15
## Path 15: 19 20 10 4 12 11 14 9 6 13 3 18 5 22 21 16 15
## Path 16: 20 12 4 11 10 6 14 19 9 13 3 18 5 22 21 16 15
## Path 17: 21 22 12 4 11 10 6 14 19 9 13 3 18 5 20 16 15
## Path 18: 22 21 12 4 11 10 6 14 19 9 13 3 18 5 20 16 15
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 0.1895942 -148.0550 1799 6
## spec 2: 0.1651644 -122.3329 1799 7
##
## Retained regressors (final model):
##
## vconst arch1 arch4 arch6 arch7 logEqWMA(2) op2_dk1_exp
## # A tibble: 1,813 × 6
## date p_dk1_price p_dk1_load p_dk1_wind p_dk1_pen p_dk1_exp
## <date> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2010-01-01 3.62 7.70 6.07 -1.62 1.36
## 2 2010-01-02 3.79 7.82 6.59 -1.23 0.0989
## 3 2010-01-03 3.77 7.78 4.75 -3.05 0.431
## 4 2010-01-04 3.83 8.11 5.46 -2.65 0.351
## 5 2010-01-05 3.93 8.16 6.57 -1.58 0.186
## 6 2010-01-06 3.90 8.09 6.66 -1.43 0.375
## 7 2010-01-07 4.10 8.09 5.77 -2.31 0.407
## 8 2010-01-08 3.96 8.11 6.30 -1.80 0.689
## 9 2010-01-09 3.74 7.85 7.19 -0.661 1.16
## 10 2010-01-10 3.61 7.83 7.51 -0.325 1.26
## # ℹ 1,803 more rows
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 1.748866 2.211920 0.6251 0.429145
## arch1 2 0 0.175281 0.036380 4.8181 1.573e-06 ***
## arch2 3 0 -0.037836 0.037969 -0.9965 0.319147
## arch3 4 0 -0.039307 0.026388 -1.4896 0.136502
## arch4 5 0 0.015597 0.027325 0.5708 0.568224
## arch5 6 0 0.002618 0.027008 0.0969 0.922789
## arch6 7 0 0.074790 0.026980 2.7721 0.005628 **
## arch7 8 0 0.152106 0.027558 5.5195 3.902e-08 ***
## arch8 9 0 0.034448 0.024775 1.3905 0.164565
## arch9 10 0 -0.034748 0.024754 -1.4038 0.160563
## arch10 11 0 0.024846 0.024717 1.0052 0.314932
## arch11 12 0 0.022674 0.024652 0.9198 0.357821
## arch12 13 0 -0.002436 0.024769 -0.0984 0.921665
## arch13 14 0 0.019134 0.024835 0.7704 0.441153
## arch14 15 0 0.067276 0.024183 2.7820 0.005459 **
## logEqWMA(2) 16 0 0.172992 0.084123 2.0564 0.039888 *
## logEqWMA(5) 17 0 0.055213 0.143303 0.3853 0.700072
## logEqWMA(7) 18 0 0.104332 0.165657 0.6298 0.528902
## logEqWMA(14) 19 0 -0.104788 0.123026 -0.8518 0.394466
## p_dk1_load 20 0 -7.042586 4.245288 -1.6589 0.097309 .
## p_dk1_wind 21 0 6.824227 4.221929 1.6164 0.106191
## p_dk1_pen 22 0 -6.839021 4.225353 -1.6186 0.105718
## p_dk1_exp 23 0 0.253469 0.054342 4.6643 3.327e-06 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 394.799 1 0.000000
## Ljung-Box ARCH(15) 30.523 15 0.010168
## 19 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
##
## Path 1: 3 6 13 5 18 19 14 11 12 9 10 4 17 21 22 20 15 16
## Path 2: 4 17 13 6 5 14 19 11 3 12 9 10 18 21 22 20 15 16
## Path 3: 5 13 6 18 14 19 11 3 12 9 10 4 17 21 22 20 15 16
## Path 4: 6 13 17 14 19 12 3 5 11 4 9 10 18 21 22 20 15 16
## Path 5: 7 13 17 6 5 3 11 19 14 12 9 10 21 22 20 16 4 15
## Path 6: 9 6 13 17 19 14 12 3 5 11 10 4 18 21 22 20 15 16
## Path 7: 10 13 6 17 11 14 5 19 9 3 12 4 18 21 22 20 15 16
## Path 8: 11 6 13 17 14 19 5 3 12 4 9 10 18 21 22 20 15 16
## Path 9: 12 13 6 17 19 14 3 5 11 4 9 10 18 21 22 20 15 16
## Path 10: 13 6 17 14 19 12 3 5 11 4 9 10 18 21 22 20 15 16
## Path 11: 14 13 6 17 19 12 3 5 11 4 9 10 18 21 22 20 15 16
## Path 12: 15 6 13 19 18 5 12 3 11 4 14 17 10 9 21 22 20 16
## Path 13: 16 5 13 6 18 14 19 11 3 12 10 9 4 21 22 20 17 15
## Path 14: 17 13 6 14 19 12 3 5 11 4 9 10 18 21 22 20 15 16
## Path 15: 18 6 13 5 14 19 11 3 12 9 10 4 17 21 22 20 15 16
## Path 16: 19 6 18 13 14 5 11 3 12 9 10 4 17 21 22 20 15 16
## Path 17: 20 6 13 17 22 21 5 14 19 3 11 12 4 9 10 18 15 16
## Path 18: 21 6 13 22 17 20 5 14 19 3 11 12 4 9 10 18 15 16
## Path 19: 22 6 13 21 17 20 5 14 19 3 11 12 4 9 10 18 15 16
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 0.4348420 -372.4030 1799 5
## spec 2: 0.3995534 -340.6608 1799 5
##
## Retained regressors (final model):
##
## vconst arch1 arch7 logEqWMA(7) p_dk1_exp
intraday_data_dk2 %>%
select(date, op1_dk2_price, op2_dk2_price, p_dk2_price) %>%
pivot_longer(cols = !date) %>%
ggplot() +
geom_line(aes(x = date, y = value, color = name), linewidth = 0.1) +
labs(main = "dk2: Intraday Electricity Prices")
intraday_data_dk2 %>% arrange(date) %>% identical(intraday_data_dk2)
## [1] TRUE
for(dep in c("op1_dk2_", "op2_dk2_", "p_dk2_")){
temp <- intraday_data_dk2 %>%
select(date, contains(dep))
print(temp)
dep2 <- as.matrix(temp[paste0(dep, "price")])
vxregs <- as.matrix(temp[!(names(temp) %in% c("date", paste0(dep, "price")))])
temp_mod <- arx(dep2,
arch = 1:14,
vxreg = vxregs,
log.ewma = c(2, 5, 7, 14))
assign(paste0("dk2_", dep, "mod"), temp_mod)
temp_vmod <- getsv(temp_mod, t.pval = 0.001, ar.LjungB = NULL, arch.LjungB = NULL)
assign(paste0("dk2_", dep, "vmod"), temp_vmod)
printtex(temp_vmod)
plot(temp_vmod)
}
## # A tibble: 1,816 × 6
## date op1_dk2_price op1_dk2_load op1_dk2_wind op1_dk2_pen op1_dk2_exp
## <date> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2010-01-01 3.67 7.28 4.82 -2.45 0.497
## 2 2010-01-02 3.68 7.29 4.90 -2.40 0.481
## 3 2010-01-03 3.70 7.25 4.17 -3.07 0.687
## 4 2010-01-04 3.75 7.41 5.30 -2.10 0.884
## 5 2010-01-05 3.76 7.45 4.80 -2.62 0.681
## 6 2010-01-06 3.78 7.42 4.91 -2.48 0.910
## 7 2010-01-07 4.07 7.42 4.64 -2.77 0.813
## 8 2010-01-08 5.15 7.47 4.51 -2.96 1.05
## 9 2010-01-09 3.83 7.29 6.05 -1.25 1.35
## 10 2010-01-10 3.81 7.36 6.43 -0.936 1.22
## # ℹ 1,806 more rows
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 2.0846581 2.9842730 0.4880 0.4848345
## arch1 2 0 0.1701187 0.0363692 4.6776 3.122e-06 ***
## arch2 3 0 -0.0418708 0.0364035 -1.1502 0.2502217
## arch3 4 0 0.0618691 0.0264923 2.3354 0.0196351 *
## arch4 5 0 0.0872872 0.0269417 3.2399 0.0012180 **
## arch5 6 0 0.0497003 0.0271839 1.8283 0.0676715 .
## arch6 7 0 0.0630632 0.0271463 2.3231 0.0202869 *
## arch7 8 0 0.1185157 0.0275589 4.3005 1.797e-05 ***
## arch8 9 0 0.0753762 0.0247884 3.0408 0.0023940 **
## arch9 10 0 -0.0026942 0.0250186 -0.1077 0.9142544
## arch10 11 0 -0.0104003 0.0249410 -0.4170 0.6767320
## arch11 12 0 -0.0288095 0.0249267 -1.1558 0.2479312
## arch12 13 0 0.0025599 0.0250103 0.1024 0.9184880
## arch13 14 0 -0.0085318 0.0248995 -0.3426 0.7319040
## arch14 15 0 0.0602917 0.0240353 2.5085 0.0122142 *
## logEqWMA(2) 16 0 0.3182909 0.0766389 4.1531 3.435e-05 ***
## logEqWMA(5) 17 0 -0.1671147 0.1224058 -1.3653 0.1723467
## logEqWMA(7) 18 0 0.0366417 0.1371773 0.2671 0.7894141
## logEqWMA(14) 19 0 0.0605627 0.0987853 0.6131 0.5399063
## op1_dk2_load 20 0 -0.5253182 2.2945104 -0.2289 0.8189375
## op1_dk2_wind 21 0 0.3679733 2.3131041 0.1591 0.8736223
## op1_dk2_pen 22 0 -0.2957501 2.3070646 -0.1282 0.8980106
## op1_dk2_exp 23 0 0.2987772 0.0806134 3.7063 0.0002167 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 358.765 1 0.00000
## Ljung-Box ARCH(15) 22.058 15 0.10629
## 18 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
##
## Path 1: 3 22 13 10 18 14 11 20 19 12 17 6 4 21 15
## Path 2: 4 10 13 11 22 18 14 20 19 17 3 12 6 21 15
## Path 3: 5 10 18 22 14 13 11 17 19 20 12 3 21 6 4 15
## Path 4: 6 10 18 14 13 22 11 20 19 17 3 12 4 21 15
## Path 5: 7 10 14 22 13 11 19 20 3 12 21 18 17 4 6 15
## Path 6: 9 18 13 22 14 11 10 20 3 19 12 17 6 21 4 15
## Path 7: 10 13 22 18 14 11 20 19 3 12 17 6 4 21 15
## Path 8: 11 13 22 10 18 14 20 19 3 12 17 6 4 21 15
## Path 9: 12 10 13 22 19 14 20 11 18 3 17 6 4 21 15
## Path 10: 13 10 22 18 14 11 20 19 3 12 17 6 4 21 15
## Path 11: 14 13 10 22 18 11 20 19 3 12 17 6 4 21 15
## Path 12: 15 18 22 13 10 14 11 20 3 12 19 17 6 21 4
## Path 13: 17 13 10 22 14 11 19 20 18 3 6 12 4 21 15
## Path 14: 18 13 10 22 14 11 20 19 3 12 17 6 4 21 15
## Path 15: 19 10 22 14 13 11 20 18 3 12 17 6 4 21 15
## Path 16: 20 13 10 18 14 21 11 19 3 12 17 6 4 22 15
## Path 17: 21 13 10 18 14 20 11 19 3 12 17 6 4 22 15
## Path 18: 22 13 10 18 14 11 20 19 3 12 17 6 4 21 15
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 0.8378096 -724.8798 1802 8
## spec 2: 0.8350453 -726.1375 1802 7
## spec 3: 0.8517737 -741.2098 1802 7
## spec 4: 0.8375691 -728.4114 1802 7
##
## Retained regressors (final model):
##
## vconst arch1 arch6 arch7 arch8 logEqWMA(2) op1_dk2_exp
## % Date: Tue Sep 17 14:26:55 2024
## % LaTeX code generated in R 4.3.1 by the gets package
## % Note: The {eqnarray} environment requires the {amsmath} package
## \begin{eqnarray}
## \widehat{e} &=& \underset{(0.0324)}{0.5921} + \underset{(0.0228)}{0.1884}arch1 + \underset{(0.0240)}{0.1006}arch6 + \underset{(0.0233)}{0.1445}arch7 + \underset{(0.0431)}{0.0923}arch8 + \underset{(0.0684)}{0.2567}logEqWMA(2) + \underset{(NA)}{0.3286}op1_dk2_exp - \underset{(NA)}{1.5046}Elnz2 \\[2mm]
## && R^2=NA \qquad \widehat{\sigma}=0.4437 \qquad LogL=-726.1375 \qquad T = 1802 \nonumber \\
## \end{eqnarray}
## # A tibble: 1,816 × 6
## date op2_dk2_price op2_dk2_load op2_dk2_wind op2_dk2_pen op2_dk2_exp
## <date> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2010-01-01 3.70 7.45 4.69 -2.76 0.271
## 2 2010-01-02 3.79 7.48 5.06 -2.43 0.0560
## 3 2010-01-03 3.76 7.52 4.15 -3.34 0.524
## 4 2010-01-04 3.87 7.60 4.52 -3.09 0.679
## 5 2010-01-05 3.86 7.61 4.37 -3.25 0.606
## 6 2010-01-06 3.85 7.67 4.32 -3.34 0.441
## 7 2010-01-07 4.19 7.67 3.98 -3.69 0.461
## 8 2010-01-08 4.16 7.63 5.79 -1.83 0.964
## 9 2010-01-09 3.82 7.52 6.37 -1.14 0.895
## 10 2010-01-10 3.83 7.55 6.28 -1.27 0.961
## # ℹ 1,806 more rows
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 4.2344399 2.7765054 2.3259 0.1272349
## arch1 2 0 0.1714824 0.0361237 4.7471 2.229e-06 ***
## arch2 3 0 -0.0597270 0.0381317 -1.5663 0.1174481
## arch3 4 0 0.0078438 0.0267830 0.2929 0.7696591
## arch4 5 0 0.0618698 0.0273163 2.2649 0.0236361 *
## arch5 6 0 -0.0015604 0.0274335 -0.0569 0.9546475
## arch6 7 0 0.1261577 0.0272541 4.6289 3.941e-06 ***
## arch7 8 0 0.0939292 0.0282651 3.3232 0.0009081 ***
## arch8 9 0 0.0070582 0.0250930 0.2813 0.7785286
## arch9 10 0 -0.0520225 0.0250207 -2.0792 0.0377440 *
## arch10 11 0 0.0097418 0.0250345 0.3891 0.6972235
## arch11 12 0 0.0199281 0.0248816 0.8009 0.4232864
## arch12 13 0 -0.0309765 0.0248653 -1.2458 0.2130127
## arch13 14 0 0.0499864 0.0248789 2.0092 0.0446677 *
## arch14 15 0 0.0469284 0.0236393 1.9852 0.0472771 *
## logEqWMA(2) 16 0 0.3177781 0.0845986 3.7563 0.0001780 ***
## logEqWMA(5) 17 0 0.3188766 0.1460412 2.1835 0.0291315 *
## logEqWMA(7) 18 0 -0.1314522 0.1587771 -0.8279 0.4078361
## logEqWMA(14) 19 0 -0.1143233 0.0949523 -1.2040 0.2287466
## op2_dk2_load 20 0 -1.4300365 3.2761761 -0.4365 0.6625301
## op2_dk2_wind 21 0 0.9197847 3.2663561 0.2816 0.7782880
## op2_dk2_pen 22 0 -0.8991733 3.2676477 -0.2752 0.7832141
## op2_dk2_exp 23 0 0.3878186 0.0657336 5.8999 4.346e-09 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 481.1795 1 0.0000
## Ljung-Box ARCH(15) 3.1111 15 0.9995
## 17 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
##
## Path 1: 3 4 6 9 22 11 21 18 12 13 20 14 19 15 10 17
## Path 2: 4 6 9 22 11 21 12 19 13 14 20 3 18 15 10 17
## Path 3: 5 6 22 4 9 11 21 18 13 12 20 3 14 19 10 15
## Path 4: 6 22 9 4 11 21 12 19 13 14 20 3 18 15 10 17
## Path 5: 9 6 22 4 11 21 12 19 13 14 20 3 18 15 10 17
## Path 6: 10 11 4 9 6 22 18 21 12 13 20 3 14 19 15 17
## Path 7: 11 6 22 9 4 21 12 19 13 14 20 3 18 15 10 17
## Path 8: 12 6 9 22 4 11 21 19 13 14 20 3 18 15 10 17
## Path 9: 13 6 9 22 11 4 21 12 18 20 3 14 19 15 10 17
## Path 10: 14 6 9 22 4 11 21 19 12 13 20 3 18 15 10 17
## Path 11: 15 6 22 4 9 11 21 19 12 13 20 18 3 14 10 17
## Path 12: 17 9 22 11 21 6 4 12 13 20 19 18 14 3 10 15
## Path 13: 18 6 22 9 4 11 21 12 13 20 3 14 19 15 10 17
## Path 14: 19 6 9 11 22 4 21 12 13 14 20 3 18 15 10 17
## Path 15: 20 6 9 4 11 18 12 13 21 22 3 14 19 15 10 17
## Path 16: 21 6 9 4 11 22 12 19 13 14 20 3 18 15 10 17
## Path 17: 22 6 9 4 11 21 12 19 13 14 20 3 18 15 10 17
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 0.1894386 -144.4459 1802 7
## spec 2: 0.1446259 -104.0697 1802 7
##
## Retained regressors (final model):
##
## vconst arch1 arch6 arch7 logEqWMA(2) logEqWMA(5) op2_dk2_exp
## % Date: Tue Sep 17 14:26:55 2024
## % LaTeX code generated in R 4.3.1 by the gets package
## % Note: The {eqnarray} environment requires the {amsmath} package
## \begin{eqnarray}
## \widehat{e} &=& \underset{(0.0318)}{0.3510} + \underset{(0.0236)}{0.2022}arch1 + \underset{(0.0230)}{0.1134}arch6 + \underset{(0.0551)}{0.0841}arch7 + \underset{(0.0557)}{0.1975}logEqWMA(2) + \underset{(0.0535)}{0.2471}logEqWMA(5) + \underset{(NA)}{0.3543}op2_dk2_exp - \underset{(NA)}{1.0021}Elnz2 \\[2mm]
## && R^2=NA \qquad \widehat{\sigma}=0.3241 \qquad LogL=-104.0697 \qquad T = 1802 \nonumber \\
## \end{eqnarray}
## # A tibble: 1,816 × 6
## date p_dk2_price p_dk2_load p_dk2_wind p_dk2_pen p_dk2_exp
## <date> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 2010-01-01 3.70 7.48 5.03 -2.43 0.223
## 2 2010-01-02 3.99 7.63 5.11 -2.51 0.156
## 3 2010-01-03 3.84 7.61 3.55 -4.05 0.389
## 4 2010-01-04 4.53 7.75 5.58 -2.17 0.532
## 5 2010-01-05 4.18 7.82 4.39 -3.43 0.317
## 6 2010-01-06 4.00 7.75 4.25 -3.50 0.374
## 7 2010-01-07 5.23 7.75 4.39 -3.36 0.528
## 8 2010-01-08 6.13 7.76 5.33 -2.43 0.761
## 9 2010-01-09 3.98 7.62 6.32 -1.30 0.955
## 10 2010-01-10 3.88 7.65 6.38 -1.27 0.839
## # ℹ 1,806 more rows
## GUM log-variance equation:
##
## reg.no. keep coef std.error t-stat p-value
## vconst 1 1 0.82023915 2.40732128 0.1161 0.733309
## arch1 2 0 0.16612433 0.03539240 4.6938 2.887e-06 ***
## arch2 3 0 -0.09098698 0.03695970 -2.4618 0.013919 *
## arch3 4 0 0.01414347 0.02610639 0.5418 0.588050
## arch4 5 0 0.05897363 0.02695908 2.1875 0.028834 *
## arch5 6 0 0.02932308 0.02681526 1.0935 0.274313
## arch6 7 0 0.07237627 0.02715552 2.6653 0.007763 **
## arch7 8 0 0.11145787 0.02772556 4.0200 6.062e-05 ***
## arch8 9 0 0.06486690 0.02457404 2.6397 0.008372 **
## arch9 10 0 -0.02695332 0.02483284 -1.0854 0.277896
## arch10 11 0 0.00098512 0.02464778 0.0400 0.968123
## arch11 12 0 -0.02547469 0.02467143 -1.0326 0.301951
## arch12 13 0 -0.02409036 0.02456959 -0.9805 0.326975
## arch13 14 0 -0.02925946 0.02462890 -1.1880 0.234987
## arch14 15 0 0.12956578 0.02388867 5.4237 6.636e-08 ***
## logEqWMA(2) 16 0 0.26034008 0.08189343 3.1790 0.001503 **
## logEqWMA(5) 17 0 -0.25387549 0.14748055 -1.7214 0.085349 .
## logEqWMA(7) 18 0 0.41198687 0.18593513 2.2158 0.026834 *
## logEqWMA(14) 19 0 -0.09416325 0.13263956 -0.7099 0.477848
## p_dk2_load 20 0 -2.31956939 4.51660852 -0.5136 0.607620
## p_dk2_wind 21 0 2.25826603 4.48580358 0.5034 0.614728
## p_dk2_pen 22 0 -2.23034813 4.48540797 -0.4972 0.619078
## p_dk2_exp 23 0 0.34339376 0.06962025 4.9324 8.880e-07 ***
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Diagnostics:
##
## Chi-sq df p-value
## Ljung-Box AR(1) 433.832 1 0.00000
## Ljung-Box ARCH(15) 17.746 15 0.27626
## 18 path(s) to search
## Searching: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
##
## Path 1: 3 11 4 22 20 19 21 6 13 10 17 16 5 14 12 9 7
## Path 2: 4 11 22 20 21 19 6 13 10 17 14 5 12 9 18 3
## Path 3: 5 11 22 20 4 12 21 6 17 14 10 13 19 9 18 3
## Path 4: 6 11 4 22 20 21 13 10 12 14 17 5 19 9 18 3
## Path 5: 7 11 22 20 4 13 21 10 14 12 6 5 17 16 3 19 9
## Path 6: 9 11 19 22 20 4 10 21 6 13 17 14 18 12 5 3
## Path 7: 10 11 4 22 20 21 13 6 12 14 17 5 19 9 18 3
## Path 8: 11 22 20 4 21 19 6 13 10 17 14 5 12 9 18 3
## Path 9: 12 11 4 22 20 21 6 14 10 13 17 5 19 9 18 3
## Path 10: 13 11 22 20 4 21 6 10 12 14 17 5 19 9 18 3
## Path 11: 14 11 22 20 4 21 6 12 10 13 17 5 19 9 18 3
## Path 12: 16 11 4 3 22 20 6 21 10 13 14 17 5 12 19 9 7
## Path 13: 17 11 4 22 20 6 21 19 13 10 14 5 12 9 18 3
## Path 14: 18 11 17 4 22 20 21 19 6 13 10 14 12 9 5 3
## Path 15: 19 11 22 20 4 21 6 13 10 17 14 5 12 9 18 3
## Path 16: 20 11 21 4 22 19 6 13 10 17 14 5 12 9 18 3
## Path 17: 21 11 20 4 22 19 6 13 10 17 14 5 12 9 18 3
## Path 18: 22 11 20 4 21 19 6 13 10 17 14 5 12 9 18 3
##
## Terminal models:
##
## info(sc) logl n k
## spec 1: 0.4913591 -420.2246 1802 6
## spec 2: 0.5227186 -444.7312 1802 7
##
## Retained regressors (final model):
##
## vconst arch1 arch7 arch14 logEqWMA(7) p_dk2_exp
## % Date: Tue Sep 17 14:26:55 2024
## % LaTeX code generated in R 4.3.1 by the gets package
## % Note: The {eqnarray} environment requires the {amsmath} package
## \begin{eqnarray}
## \widehat{e} &=& \underset{(0.0233)}{0.3995} + \underset{(0.0241)}{0.2392}arch1 + \underset{(0.0219)}{0.1411}arch7 + \underset{(0.0542)}{0.1297}arch14 + \underset{(0.0666)}{0.3093}logEqWMA(7) + \underset{(NA)}{0.3586}p_dk2_exp - \underset{(NA)}{1.1591}Elnz2 \\[2mm]
## && R^2=NA \qquad \widehat{\sigma}=0.3335 \qquad LogL=-420.2246 \qquad T = 1802 \nonumber \\
## \end{eqnarray}
Using data from EMBER on European wholesale electricity prices (hourly - daily and monthly also exist), I perform the same analysis as above. The hourly prices are the day-ahead wholesale prices by country.
Here, see the time series for Germany and Denmark (to compare to the data avialable in Rintamaki et al. - color portion of the TS plots). UK spotlight to discuss potential interest to David.